/* * ProfilerPlaneV.cpp * * Created on: Sep 29, 2015 * Author: Hovanes Egiyan */ #include "ProfilerPlaneV.hh" #include "ProfilerDetector.hh" //#include "bpScalers.h" using namespace std; unsigned ProfilerPlaneV::ppvSleepTime = 1; ProfilerPlaneV::ProfilerPlaneV( ProfilerDetector* det, bool reversedAxis ) : MutexedClass(), ProfilerPlaneData( reversedAxis ), ProfilerDetComponent( det ), ProfilerPlaneDataFitter() { cout << " Entering good " << __FUNCTION__ << endl; } // Copy constructor ProfilerPlaneV::ProfilerPlaneV( const ProfilerPlaneV& p ) : MutexedClass( p ), ProfilerPlaneData( p ), ProfilerDetComponent( p ), ProfilerPlaneDataFitter( p ), ppvIsSimulation( p.ppvIsSimulation ) { cout << " Entering " << __FUNCTION__ << endl; } // Destructor ProfilerPlaneV::~ProfilerPlaneV() { // closeMutex(); } // Assignment operator ProfilerPlaneV& ProfilerPlaneV::operator=( const ProfilerPlaneV& p ) { MutexedClass::operator =( p ); ProfilerPlaneData::operator =( p ); ProfilerDetComponent::operator=( p ); ProfilerPlaneDataFitter::operator=( p ); MtxLock objLock( mcMutex ); ppvIsSimulation = p.ppvIsSimulation; return *this; } // Method to register the flag for synchronization with a new sequencer ID. void ProfilerPlaneV::registerFlag( const SS_ID ssID, const EV_ID flagID, const std::string flagName ) { cout << " Try to register flag " << flagName << " for detector " << getDetector()->getName() << ":" << getName() << endl; MtxLock obLock( mcMutex ); // Each ssID can only have one synchronization flag, that is the convention. if ( ppvFlag.count( ssID ) == 0 ) { // cout << "There were no flag from SSID" << ssID << " , inserting " << endl; map tmpMap; tmpMap[flagName] = flagID; ppvFlag[ssID] = tmpMap; } else { // cout << "There were already flag from SSID " << ssID << " , adding " << // flagID << " as " << flagName << endl; ppvFlag[ssID][flagName] = flagID; } cout << "Flag " << flagName << " has been registered for detector " << getDetector()->getName() << ":" << getName() << endl; return; } // Override the setPVs method so that it is followed by changing the number of // slices for the simulators. inline ProfilerPVs* ProfilerPlaneV::setPVs( ProfilerPVs* pv ) { ProfilerDetComponent::setPVs( pv ); // setNumberOfSlices( getNSlices() ); return pv; }