EFDetectorHits Class Reference

#include <EFDetectorHits.h>

Inheritance diagram for EFDetectorHits:

IEFAlgorithm List of all members.

Public Member Functions

 EFDetectorHits (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~EFDetectorHits ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
virtual void reset ()

Protected Attributes

int m_output
float m_beam
PropertyMgr m_propMgr
bool m_run
HltStoreSvcm_HltStoreSvc
IRawDataProviderSvcm_rawDigiSvc
EFResultm_ef

Private Attributes

CriteriaItemValuem_nmdc
CriteriaItemValuem_nmuc
CriteriaItemValuem_ntof
CriteriaItemValuem_nemc
CriteriaItemValuem_derr
CriteriaItemValuem_rndm

Detailed Description

Definition at line 16 of file EFDetectorHits.h.


Constructor & Destructor Documentation

EFDetectorHits::EFDetectorHits ( const std::string name,
ISvcLocator *  pSvcLocator 
)

Definition at line 24 of file EFDetectorHits.cxx.

References m_derr, m_nemc, m_nmdc, m_nmuc, m_ntof, IEFAlgorithm::m_output, m_rndm, msgSvc(), and output.

00024                                                                               :
00025   IEFAlgorithm(name, pSvcLocator) {
00026  
00027   int output=m_output/100000;
00028 #if 1
00029   //m_propMgr.declareProperty("OutputLevel", output);
00030   //cout << "OutputLevel="<<output<<";  name="<<name<<endl;
00031   // Get a pointer to the Job Options Service
00032   //IJobOptionsSvc* jobSvc;
00033   //Gaudi::svcLocator()->service("JobOptionsSvc", jobSvc);
00034   //jobSvc->setMyProperties("EFDetector", &m_propMgr);
00035   //cout << "OutputLevel="<<output<<";  name="<<name<<endl;
00036 #endif
00037   MsgStream log(msgSvc(), name);
00038   msgSvc()->setOutputLevel(name,output);
00039 
00040   m_nmdc = new CriteriaItemValue;
00041   m_nmuc = new CriteriaItemValue;
00042   m_ntof = new CriteriaItemValue;
00043   m_nemc = new CriteriaItemValue;
00044   m_derr = new CriteriaItemValue;
00045   m_rndm = new CriteriaItemValue;
00046 }

EFDetectorHits::~EFDetectorHits (  )  [virtual]

Definition at line 48 of file EFDetectorHits.cxx.

References m_derr, m_nemc, m_nmdc, m_nmuc, m_ntof, and m_rndm.

00048                                 {
00049   delete m_nmdc;
00050   delete m_nmuc;
00051   delete m_ntof;
00052   delete m_nemc;
00053   delete m_derr;
00054   delete m_rndm;
00055 }


Member Function Documentation

StatusCode EFDetectorHits::execute (  )  [virtual]

Definition at line 99 of file EFDetectorHits.cxx.

References EFResult::addToEFVec(), EmcRawDataProvider::CutTime, EmcRawDataProvider::DropDead, EmcRawDataProvider::DropHot, EmcRawDataProvider::DropLow, Bes_Common::FATAL, IRawDataProviderSvc::getEmcDigiVec(), IRawDataProviderSvc::getMdcDigiVec(), Bes_Common::INFO, IRawDataProviderSvc::isOnlineMode(), IEFAlgorithm::m_ef, m_nemc, m_nmdc, m_nmuc, m_ntof, IEFAlgorithm::m_rawDigiSvc, m_rndm, IEFAlgorithm::m_run, msgSvc(), CriteriaItemValue::setValue(), and EFResult::setVecBit().

00099                                    {
00100   
00101   //reset();
00102 
00103   MsgStream log(msgSvc(), name());
00104   
00105   // Part 1: Get the event header, print out event number
00106   SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
00107   if (!eventHeader) {
00108     log << MSG::FATAL << "Could not find Event Header" << endreq;
00109     return( StatusCode::FAILURE);
00110   }
00111   log << MSG::INFO << "eventNo-->" << eventHeader->eventNumber()<<endreq;
00112 
00113   //Part 2: Retrieve Hits Collection 
00114   SmartDataPtr<MdcDigiCol> mdcDigiCol(eventSvc(),"/Event/Digi/MdcDigiCol");
00115   if (!mdcDigiCol) {
00116     log << MSG::FATAL << "Could not find Mdc digi!!" << endreq;
00117     return( StatusCode::FAILURE);
00118   }
00119 
00120   SmartDataPtr<TofDigiCol> tofDigiCol(eventSvc(),"/Event/Digi/TofDigiCol");
00121   if (!tofDigiCol) {
00122     log << MSG::FATAL << "Could not find Tof digi!!" << endreq;
00123     return( StatusCode::FAILURE);
00124   }
00125   SmartDataPtr<EmcDigiCol> emcDigiCol(eventSvc(),"/Event/Digi/EmcDigiCol");
00126   if (!emcDigiCol) {
00127     log << MSG::FATAL << "Could not find Emc digi!!" << endreq;
00128     return( StatusCode::FAILURE);
00129   }
00130   if(m_rawDigiSvc){
00131     if(m_rawDigiSvc->isOnlineMode()){
00132       emcDigiCol=&(m_rawDigiSvc->getEmcDigiVec(EmcRawDataProvider::DropLow|EmcRawDataProvider::CutTime|EmcRawDataProvider::DropHot|EmcRawDataProvider::DropDead));
00133     }
00134   }
00135   
00136   SmartDataPtr<MucDigiCol> mucDigiCol(eventSvc(),"/Event/Digi/MucDigiCol");
00137   if (!mucDigiCol) {
00138     log << MSG::FATAL << "Could not find Muc digi!!" << endreq;
00139     return( StatusCode::FAILURE);
00140   }
00141 
00142   //Part 3: Get information of hits
00143   unsigned int nhitsMdc=mdcDigiCol->size();
00144   if(m_rawDigiSvc){
00145     if(m_rawDigiSvc->isOnlineMode()){
00146       nhitsMdc=m_rawDigiSvc->getMdcDigiVec(0x38000).size();
00147     }
00148   }
00149   unsigned int nhitsEmc=emcDigiCol->size();
00150   unsigned int nhitsMuc=mucDigiCol->size();
00151   unsigned int nhitsTof=tofDigiCol->size();
00152 
00153   double rndm=CLHEP::RandFlat::shoot();
00154   
00155   log << MSG::INFO << " Number of hits in MDC:EMC:MUC:TOF is " << nhitsMdc
00156       << ":" << nhitsEmc << ":" << nhitsMuc << ":" <<nhitsTof <<";  " 
00157       << "random number:" << rndm <<endreq;
00158 
00159   //Part 4: Put the criteria item(s) to HltStoreSvc here
00160   m_nmdc->setValue(nhitsMdc);
00161   m_nmuc->setValue(nhitsMuc);
00162   m_ntof->setValue(nhitsTof);
00163   m_nemc->setValue(nhitsEmc);
00164 
00165   m_rndm->setValue(rndm);
00166 
00167   m_ef->addToEFVec(nhitsMdc, 5);
00168   m_ef->addToEFVec(nhitsTof, 25);
00169   m_ef->addToEFVec(nhitsEmc, 30);
00170   m_ef->addToEFVec(nhitsMuc, 52);
00171  
00172   m_ef->addToEFVec(0xFFFFFFF7,37);   //nsec init                                                                          
00173  
00174   m_ef->setVecBit(true, 0, 0);
00175   m_ef->addToEFVec(1, 1);
00176   m_ef->addToEFVec(1<<8, 1);
00177   m_ef->addToEFVec(1<<16, 1);
00178   m_ef->addToEFVec(1<<24, 1);
00179 
00180   m_run=1;
00181 
00182   return StatusCode::SUCCESS;
00183 }

StatusCode EFDetectorHits::finalize (  )  [virtual]

Definition at line 185 of file EFDetectorHits.cxx.

References Bes_Common::INFO, and msgSvc().

00185                                     {
00186   MsgStream log(msgSvc(), name());
00187   log << MSG::INFO << "in finalize()" << endmsg;
00188   return StatusCode::SUCCESS;
00189 }

StatusCode EFDetectorHits::initialize (  )  [virtual]

Reimplemented from IEFAlgorithm.

Definition at line 57 of file EFDetectorHits.cxx.

References calibUtil::ERROR, Bes_Common::INFO, IEFAlgorithm::initialize(), m_derr, IEFAlgorithm::m_HltStoreSvc, m_nemc, m_nmdc, m_nmuc, m_ntof, m_rndm, msgSvc(), and HltStoreSvc::put().

00057                                      {
00058 
00059   MsgStream log(msgSvc(), name());
00060   log << MSG::INFO << "in initialize()" << endreq;
00061 
00062   IEFAlgorithm::initialize();
00063 
00064   StatusCode sc;
00065   sc = m_HltStoreSvc->put("nmdc", m_nmdc);
00066   if ( sc.isFailure() ) {
00067     log << MSG::ERROR << "m_HltStoreSvc->put(nmdc) wrong" << endreq;
00068     return sc;
00069   }
00070   sc = m_HltStoreSvc->put("nmuc", m_nmuc);
00071   if ( sc.isFailure() ) {
00072     log << MSG::ERROR << "m_HltStoreSvc->put(nmuc) wrong" << endreq;
00073     return sc;
00074   }
00075   sc = m_HltStoreSvc->put("ntof", m_ntof);
00076   if ( sc.isFailure() ) {
00077     log << MSG::ERROR << "m_HltStoreSvc->put(ntof) wrong" << endreq;
00078     return sc;
00079   }
00080   sc = m_HltStoreSvc->put("nemc", m_nemc);
00081   if ( sc.isFailure() ) {
00082     log << MSG::ERROR << "m_HltStoreSvc->put(nemc) wrong" << endreq;
00083     return sc;
00084   }
00085   sc = m_HltStoreSvc->put("derr", m_derr);
00086   if(sc.isFailure()) {
00087     log << MSG::ERROR << "m_HltStoreSvc->put(derr) wrong" << endreq;
00088     return sc;
00089   }
00090   sc = m_HltStoreSvc->put("rndm", m_rndm);
00091   if(sc.isFailure()) {
00092     log << MSG::ERROR << "m_HltStoreSvc->put(rndm) wrong" << endreq;
00093     return sc;
00094   }
00095 
00096   return StatusCode::SUCCESS;
00097 }

void EFDetectorHits::reset (  )  [virtual]

Implements IEFAlgorithm.

Definition at line 191 of file EFDetectorHits.cxx.

References m_derr, m_nemc, m_nmdc, m_nmuc, m_ntof, m_rndm, IEFAlgorithm::m_run, and CriteriaItemValue::reset().

00191                            {
00192   
00193   if(m_run){
00194     m_nmdc->reset();
00195     m_nmuc->reset();
00196     m_ntof->reset();
00197     m_nemc->reset();
00198     m_derr->reset();
00199     m_rndm->reset();
00200     m_run=0;
00201   }
00202   return;
00203 }


Member Data Documentation

float IEFAlgorithm::m_beam [protected, inherited]

Definition at line 17 of file IEFAlgorithm.h.

Referenced by EFProcessCluster::execute(), EFGlobalEnergy::execute(), IEFAlgorithm::IEFAlgorithm(), and EFGlobalEnergy::initialize().

CriteriaItemValue* EFDetectorHits::m_derr [private]

Definition at line 30 of file EFDetectorHits.h.

Referenced by EFDetectorHits(), initialize(), reset(), and ~EFDetectorHits().

EFResult* IEFAlgorithm::m_ef [protected, inherited]

Definition at line 22 of file IEFAlgorithm.h.

Referenced by EFSectorHits::execute(), EFProcessCluster::execute(), EFGlobalEnergy::execute(), EFFlightTime::execute(), execute(), EFChargedTrack::execute(), and IEFAlgorithm::initialize().

HltStoreSvc* IEFAlgorithm::m_HltStoreSvc [protected, inherited]

Definition at line 20 of file IEFAlgorithm.h.

Referenced by EFSectorHits::execute(), IEFAlgorithm::initialize(), EFSectorHits::initialize(), EFProcessCluster::initialize(), EFGlobalEnergy::initialize(), EFFlightTime::initialize(), initialize(), and EFChargedTrack::initialize().

CriteriaItemValue* EFDetectorHits::m_nemc [private]

Definition at line 29 of file EFDetectorHits.h.

Referenced by EFDetectorHits(), execute(), initialize(), reset(), and ~EFDetectorHits().

CriteriaItemValue* EFDetectorHits::m_nmdc [private]

Definition at line 26 of file EFDetectorHits.h.

Referenced by EFDetectorHits(), execute(), initialize(), reset(), and ~EFDetectorHits().

CriteriaItemValue* EFDetectorHits::m_nmuc [private]

Definition at line 27 of file EFDetectorHits.h.

Referenced by EFDetectorHits(), execute(), initialize(), reset(), and ~EFDetectorHits().

CriteriaItemValue* EFDetectorHits::m_ntof [private]

Definition at line 28 of file EFDetectorHits.h.

Referenced by EFDetectorHits(), execute(), initialize(), reset(), and ~EFDetectorHits().

int IEFAlgorithm::m_output [protected, inherited]

Definition at line 16 of file IEFAlgorithm.h.

Referenced by EFChargedTrack::EFChargedTrack(), EFDetectorHits(), EFFlightTime::EFFlightTime(), EFGlobalEnergy::EFGlobalEnergy(), EFProcessCluster::EFProcessCluster(), EFSectorHits::EFSectorHits(), and IEFAlgorithm::IEFAlgorithm().

PropertyMgr IEFAlgorithm::m_propMgr [protected, inherited]

Definition at line 18 of file IEFAlgorithm.h.

Referenced by IEFAlgorithm::IEFAlgorithm().

IRawDataProviderSvc* IEFAlgorithm::m_rawDigiSvc [protected, inherited]

Definition at line 21 of file IEFAlgorithm.h.

Referenced by EFGlobalEnergy::execute(), EFFlightTime::execute(), execute(), IEFAlgorithm::initialize(), and EFGlobalEnergy::initialize().

CriteriaItemValue* EFDetectorHits::m_rndm [private]

Definition at line 31 of file EFDetectorHits.h.

Referenced by EFDetectorHits(), execute(), initialize(), reset(), and ~EFDetectorHits().

bool IEFAlgorithm::m_run [protected, inherited]

Definition at line 19 of file IEFAlgorithm.h.

Referenced by EFSectorHits::execute(), EFProcessCluster::execute(), EFGlobalEnergy::execute(), EFFlightTime::execute(), execute(), EFChargedTrack::execute(), IEFAlgorithm::initialize(), EFSectorHits::reset(), EFProcessCluster::reset(), EFGlobalEnergy::reset(), EFFlightTime::reset(), reset(), and EFChargedTrack::reset().


Generated on Tue Nov 29 23:18:36 2016 for BOSS_7.0.2 by  doxygen 1.4.7