#include <FastQCtrTool.h>
Inheritance diagram for FastQCtrTool:
Public Types | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
enum | Status |
Public Member Functions | |
FastQCtrTool (const std::string &type, const std::string &name, const IInterface *parent) | |
virtual | ~FastQCtrTool () |
virtual StatusCode | reconstruct (const DayaBay::CalibReadout &, DayaBay::RecTrigger &) |
virtual StatusCode | initialize () |
virtual StatusCode | finalize () |
INTupleSvc * | ntupleSvc () const |
INTupleSvc * | evtColSvc () const |
IDataProviderSvc * | detSvc () const |
IDataProviderSvc * | evtSvc () const |
IIncidentSvc * | incSvc () const |
IChronoStatSvc * | chronoSvc () const |
IHistogramSvc * | histoSvc () const |
IAlgContextSvc * | contextSvc () const |
DataObject * | put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const |
DataObject * | put (DataObject *object, const std::string &address, const bool useRootInTES=true) const |
Gaudi::Utils::GetData< TYPE >::return_type | get (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
Gaudi::Utils::GetData< TYPE >::return_type | get (const std::string &location, const bool useRootInTES=true) const |
TYPE * | getDet (IDataProviderSvc *svc, const std::string &location) const |
TYPE * | getDet (const std::string &location) const |
bool | exist (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
bool | exist (const std::string &location, const bool useRootInTES=true) const |
bool | existDet (IDataProviderSvc *svc, const std::string &location) const |
bool | existDet (const std::string &location) const |
TYPE * | getOrCreate (IDataProviderSvc *svc, const std::string &location, const bool useRootInTES=true) const |
TYPE * | getOrCreate (const std::string &location, const bool useRootInTES=true) const |
TOOL * | tool (const std::string &type, const std::string &name, const IInterface *parent=0, bool create=true) const |
TOOL * | tool (const std::string &type, const IInterface *parent=0, bool create=true) const |
SERVICE * | svc (const std::string &name, const bool create=true) const |
IUpdateManagerSvc * | updMgrSvc () const |
IDataProviderSvc * | fastContainersSvc () const |
StatusCode | Error (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const |
StatusCode | Warning (const std::string &msg, const StatusCode st=StatusCode::FAILURE, const size_t mx=10) const |
StatusCode | Print (const std::string &msg, const StatusCode st=StatusCode::SUCCESS, const MSG::Level lev=MSG::INFO) const |
StatusCode | Assert (const bool ok, const std::string &message="", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Assert (const bool ok, const char *message, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Exception (const std::string &msg, const GaudiException &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Exception (const std::string &msg, const std::exception &exc, const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
StatusCode | Exception (const std::string &msg="no message", const StatusCode sc=StatusCode(StatusCode::FAILURE, true)) const |
MsgStream & | msgStream (const MSG::Level level) const |
MsgStream & | always () const |
MsgStream & | fatal () const |
MsgStream & | err () const |
MsgStream & | error () const |
MsgStream & | warning () const |
MsgStream & | info () const |
MsgStream & | debug () const |
MsgStream & | verbose () const |
MsgStream & | msg () const |
const Statistics & | counters () const |
StatEntity & | counter (const std::string &tag) const |
MSG::Level | msgLevel () const |
bool | msgLevel (const MSG::Level level) const |
void | resetMsgStream () const |
bool | typePrint () const |
bool | propsPrint () const |
bool | statPrint () const |
bool | errorsPrint () const |
long | printStat (const MSG::Level level=MSG::ALWAYS) const |
long | printErrors (const MSG::Level level=MSG::ALWAYS) const |
long | printProps (const MSG::Level level=MSG::ALWAYS) const |
void | registerCondition (const std::string &condition, StatusCode(CallerClass::*mf)()=NULL) |
void | registerCondition (const std::string &condition, CondType *&condPtrDest, StatusCode(CallerClass::*mf)()=NULL) |
void | registerCondition (char *condition, StatusCode(CallerClass::*mf)()=NULL) |
void | registerCondition (TargetClass *condition, StatusCode(CallerClass::*mf)()=NULL) |
StatusCode | runUpdate () |
TransientFastContainer< T > * | getFastContainer (const std::string &location, typename TransientFastContainer< T >::size_type initial=0) |
StatusCode | release (const IInterface *interface) const |
virtual unsigned long | release () |
const std::string & | context () const |
const std::string & | rootInTES () const |
double | globalTimeOffset () const |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvUnknown) |
virtual unsigned long | addRef () |
virtual const std::string & | name () const |
virtual const std::string & | type () const |
virtual const IInterface * | parent () const |
virtual StatusCode | configure () |
virtual StatusCode | start () |
virtual StatusCode | stop () |
virtual StatusCode | terminate () |
virtual StatusCode | reinitialize () |
virtual StatusCode | restart () |
virtual Gaudi::StateMachine::State | FSMState () const |
virtual Gaudi::StateMachine::State | targetFSMState () const |
virtual StatusCode | sysInitialize () |
virtual StatusCode | sysStart () |
virtual StatusCode | sysStop () |
virtual StatusCode | sysFinalize () |
virtual StatusCode | sysReinitialize () |
virtual StatusCode | sysRestart () |
virtual StatusCode | setProperty (const Property &p) |
virtual StatusCode | setProperty (const std::string &s) |
virtual StatusCode | setProperty (const std::string &n, const std::string &v) |
StatusCode | setProperty (const std::string &name, const TYPE &value) |
virtual StatusCode | getProperty (Property *p) const |
virtual const Property & | getProperty (const std::string &name) const |
virtual StatusCode | getProperty (const std::string &n, std::string &v) const |
virtual const std::vector< Property * > & | getProperties () const |
PropertyMgr * | getPropertyMgr () |
ISvcLocator * | serviceLocator () const |
ISvcLocator * | svcLoc () const |
IMessageSvc * | msgSvc () const |
IToolSvc * | toolSvc () const |
StatusCode | setProperties () |
StatusCode | service (const std::string &name, T *&svc, bool createIf=true) const |
StatusCode | service (const std::string &type, const std::string &name, T *&svc) const |
void | declInterface (const InterfaceID &, void *) |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
IAuditorSvc * | auditorSvc () const |
IMonitorSvc * | monitorSvc () const |
void | declareInfo (const std::string &name, const T &var, const std::string &desc) const |
void | declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const |
virtual const std::string & | type () const =0 |
virtual const IInterface * | parent () const =0 |
virtual StatusCode | configure ()=0 |
virtual StatusCode | start ()=0 |
virtual StatusCode | stop ()=0 |
virtual StatusCode | terminate ()=0 |
virtual StatusCode | reinitialize ()=0 |
virtual StatusCode | restart ()=0 |
virtual Gaudi::StateMachine::State | FSMState () const =0 |
virtual StatusCode | sysInitialize ()=0 |
virtual StatusCode | sysStart ()=0 |
virtual StatusCode | sysStop ()=0 |
virtual StatusCode | sysFinalize ()=0 |
virtual StatusCode | sysReinitialize ()=0 |
virtual StatusCode | sysRestart ()=0 |
virtual unsigned long | refCount () const =0 |
virtual const std::string & | name () const =0 |
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface)=0 |
virtual unsigned long | addRef ()=0 |
virtual unsigned long | release ()=0 |
Static Public Member Functions | |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
static const InterfaceID & | interfaceID () |
Public Attributes | |
SUCCESS | |
NO_INTERFACE | |
VERSMISMATCH | |
LAST_ERROR | |
Protected Types | |
typedef std::map< std::string, StatEntity > | Statistics |
typedef std::map< std::string, unsigned int > | Counter |
typedef std::vector< IAlgTool * > | AlgTools |
typedef std::pair< IInterface *, std::string > | ServiceEntry |
typedef std::vector< ServiceEntry > | Services |
Protected Member Functions | |
StatusCode | releaseTool (const IAlgTool *tool) const |
StatusCode | releaseSvc (const IInterface *svc) const |
int | outputLevel () const |
virtual unsigned long | refCount () const |
IntegerProperty & | outputLevelProperty () |
void | initOutputLevel (Property &prop) |
Static Protected Attributes | |
static const bool | IgnoreRootInTES |
static const bool | UseRootInTES |
Private Types | |
typedef std::map< DayaBay::DetectorSensor, bool > | UsedFeeChannelMap |
Private Member Functions | |
StatusCode | setUsedChannels (const DayaBay::CalibReadoutPmtCrate *calibCrate, DayaBay::RecTrigger *recTrigger) |
Private Attributes | |
std::string | m_cableSvcName |
ICableSvc * | m_cableSvc |
std::string | m_pmtGeomSvcName |
IPmtGeomInfoSvc * | m_pmtGeomSvc |
UsedFeeChannelMap | m_usedChannels |
Definition at line 29 of file FastQCtrTool.h.
typedef std::map<DayaBay::DetectorSensor, bool> FastQCtrTool::UsedFeeChannelMap [private] |
Definition at line 48 of file FastQCtrTool.h.
FastQCtrTool::FastQCtrTool | ( | const std::string & | type, | |
const std::string & | name, | |||
const IInterface * | parent | |||
) |
Definition at line 19 of file FastQCtrTool.cc.
00022 : GaudiTool(type, name, parent) 00023 , m_cableSvc(0) 00024 , m_pmtGeomSvc(0) 00025 , m_usedChannels() 00026 { 00027 declareInterface< IReconTool >(this); 00028 declareProperty("CableSvcName", m_cableSvcName = "StaticCableSvc", 00029 "Name of service to map between detector, hardware, and electronic IDs"); 00030 declareProperty("PmtGeomSvcName", m_pmtGeomSvcName = "PmtGeomInfoSvc", 00031 "Name of Pmt Geometry Information Service"); 00032 }
FastQCtrTool::~FastQCtrTool | ( | ) | [virtual] |
StatusCode FastQCtrTool::reconstruct | ( | const DayaBay::CalibReadout & | , | |
DayaBay::RecTrigger & | ||||
) | [virtual] |
Implements IReconTool.
Definition at line 53 of file FastQCtrTool.cc.
00055 { 00056 debug() << "running reconstruct() " << endreq; 00057 00058 if(!calibReadout.detector().isAD()){ 00059 debug() << "Ignore non-AD detector: " << calibReadout.detector().detName() 00060 << endreq; 00061 recTrigger.setEnergyStatus( ReconStatus::kNotProcessed); 00062 recTrigger.setPositionStatus( ReconStatus::kNotProcessed); 00063 return StatusCode::SUCCESS; 00064 } 00065 00066 // Get CalibPmtCrate 00067 const DayaBay::CalibReadoutPmtCrate* calibCrate 00068 = dynamic_cast<const DayaBay::CalibReadoutPmtCrate*>(&calibReadout); 00069 00070 // Check CalibPmtCrate 00071 if(calibCrate == NULL) { 00072 error() << "reconstruction(): no calib readouts." << endreq; 00073 recTrigger.setEnergyStatus( ReconStatus::kBadReadout); 00074 recTrigger.setPositionStatus( ReconStatus::kBadReadout); 00075 return StatusCode::FAILURE; 00076 } 00077 00078 // Get CalibPmtChannelReadouts 00079 DayaBay::CalibReadoutPmtCrate::PmtChannelReadouts calib_chMap; 00080 calib_chMap = calibCrate->channelReadout(); 00081 DayaBay::CalibReadoutPmtCrate::PmtChannelReadouts::const_iterator cpcrIter 00082 = calib_chMap.begin(); 00083 00084 debug() << "successfully get PmtChannelReadouts " << endreq; 00085 00086 // Context, ServiceMode for this data 00087 int task = 0; 00088 ServiceMode svcMode(calibReadout.header()->context(), task); 00089 00090 debug() << "successfully get service mode " << endreq; 00091 00092 // determine FeeChannels that used for reconstruction 00093 setUsedChannels(calibCrate, &recTrigger); 00094 00095 // Calculate the charge center, loop over all calibrated channels 00096 double sumQ = 0.0, Xc, Yc, Zc; 00097 00098 for(; cpcrIter!=calib_chMap.end(); ++cpcrIter) { 00099 00100 DayaBay::AdPmtSensor adPmtId(cpcrIter->pmtSensorId().fullPackedData()); 00101 if(m_usedChannels[adPmtId]==false) continue; 00102 00103 // Get charge on this PMT 00104 double charge = cpcrIter->maxCharge(); 00105 00106 // Get Pmt Position from its id 00107 unsigned int pmtid = adPmtId.fullPackedData(); 00108 if(adPmtId.site() == Site::kSAB) { 00109 pmtid = DayaBay::AdPmtSensor(adPmtId.ring(),adPmtId.column(),Site::kDayaBay,adPmtId.detectorId()).fullPackedData(); 00110 } 00111 const CLHEP::Hep3Vector pos = m_pmtGeomSvc->get(pmtid)->localPosition(); 00112 00113 Xc += charge * pos.x(); 00114 Yc += charge * pos.y(); 00115 Zc += charge * pos.z(); 00116 sumQ += charge; 00117 } 00118 if(sumQ!=0) { Xc /= sumQ; Yc /= sumQ; Zc /= sumQ;} 00119 double position_unit= CLHEP::millimeter; 00120 debug() << "Xc, Yc, Zc (mm): " << Xc/position_unit 00121 << ", " << Yc/position_unit << ", " << Zc/position_unit << endreq; 00122 00123 CLHEP::HepLorentzVector Qcenter(Xc, Yc, Zc, 0); 00124 recTrigger.setEnergy(sumQ/100.); 00125 recTrigger.setPosition(Qcenter); 00126 00127 return StatusCode::SUCCESS; 00128 }
StatusCode FastQCtrTool::initialize | ( | ) | [virtual] |
Reimplemented from GaudiTool.
Definition at line 36 of file FastQCtrTool.cc.
00037 { 00038 // Get Cable Service 00039 m_cableSvc = svc<ICableSvc>(m_cableSvcName, true); 00040 00041 // Get PmtGeomInfo Service 00042 m_pmtGeomSvc = svc<IPmtGeomInfoSvc>(m_pmtGeomSvcName, true); 00043 00044 return StatusCode::SUCCESS; 00045 }
StatusCode FastQCtrTool::finalize | ( | ) | [virtual] |
Reimplemented from GaudiTool.
Definition at line 48 of file FastQCtrTool.cc.
00049 { 00050 return StatusCode::SUCCESS; 00051 }
StatusCode FastQCtrTool::setUsedChannels | ( | const DayaBay::CalibReadoutPmtCrate * | calibCrate, | |
DayaBay::RecTrigger * | recTrigger | |||
) | [private] |
Definition at line 130 of file FastQCtrTool.cc.
00133 { 00134 m_usedChannels.clear(); 00135 00136 Context context = calibCrate->header()->context(); 00137 int task = 0; 00138 ServiceMode svcMode(context, task); 00139 00140 Site::Site_t site = calibCrate->detector().site(); 00141 DetectorId::DetectorId_t detid = calibCrate->detector().detectorId(); 00142 00143 // default is use all channels 00144 for(int local_id=0; local_id<192; local_id++) { 00145 int ring = local_id/24 + 1; 00146 int col = local_id%24 + 1; 00147 00148 AdPmtSensor adPmtId(ring, col, site, detid); 00149 m_usedChannels[adPmtId] = true; 00150 //FeeChannelId channelId = m_cableSvc->feeChannelId(adPmtId, svcMode); 00151 //m_usedChannels[channelId] = true; 00152 } 00153 // Other options, depending on CalibReadoutPmtCrate data 00154 00155 //recTrigger->setUsedChannels(m_usedChannels); 00156 00157 return StatusCode::SUCCESS; 00158 }
std::string FastQCtrTool::m_cableSvcName [private] |
Definition at line 53 of file FastQCtrTool.h.
ICableSvc* FastQCtrTool::m_cableSvc [private] |
Definition at line 56 of file FastQCtrTool.h.
std::string FastQCtrTool::m_pmtGeomSvcName [private] |
Definition at line 59 of file FastQCtrTool.h.
IPmtGeomInfoSvc* FastQCtrTool::m_pmtGeomSvc [private] |
Definition at line 62 of file FastQCtrTool.h.
Definition at line 65 of file FastQCtrTool.h.