Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EFDetectorHits Class Reference

#include <EFDetectorHits.h>

Inheritance diagram for EFDetectorHits:

IEFAlgorithm IEFAlgorithm List of all members.

Public Member Functions

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

Protected Attributes

float m_beam
EFResultm_ef
EFResultm_ef
HltStoreSvcm_HltStoreSvc
HltStoreSvcm_HltStoreSvc
int m_output
PropertyMgr m_propMgr
IRawDataProviderSvcm_rawDigiSvc
IRawDataProviderSvcm_rawDigiSvc
bool m_run

Private Attributes

CriteriaItemValuem_derr
CriteriaItemValuem_derr
CriteriaItemValuem_nemc
CriteriaItemValuem_nemc
CriteriaItemValuem_nmdc
CriteriaItemValuem_nmdc
CriteriaItemValuem_nmuc
CriteriaItemValuem_nmuc
CriteriaItemValuem_ntof
CriteriaItemValuem_ntof
CriteriaItemValuem_rndm
CriteriaItemValuem_rndm

Constructor & Destructor Documentation

EFDetectorHits::EFDetectorHits const std::string &  name,
ISvcLocator *  pSvcLocator
 

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]
 

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 }

EFDetectorHits::EFDetectorHits const std::string &  name,
ISvcLocator *  pSvcLocator
 

virtual EFDetectorHits::~EFDetectorHits  )  [virtual]
 


Member Function Documentation

virtual StatusCode EFDetectorHits::execute  )  [virtual]
 

StatusCode EFDetectorHits::execute  )  [virtual]
 

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 }

virtual StatusCode EFDetectorHits::finalize  )  [virtual]
 

StatusCode EFDetectorHits::finalize  )  [virtual]
 

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

virtual StatusCode EFDetectorHits::initialize  )  [virtual]
 

Reimplemented from IEFAlgorithm.

StatusCode EFDetectorHits::initialize  )  [virtual]
 

Reimplemented from IEFAlgorithm.

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 }

virtual void EFDetectorHits::reset  )  [virtual]
 

Implements IEFAlgorithm.

void EFDetectorHits::reset  )  [virtual]
 

Implements IEFAlgorithm.

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]
 

CriteriaItemValue* EFDetectorHits::m_derr [private]
 

CriteriaItemValue* EFDetectorHits::m_derr [private]
 

EFResult* IEFAlgorithm::m_ef [protected, inherited]
 

EFResult* IEFAlgorithm::m_ef [protected, inherited]
 

HltStoreSvc* IEFAlgorithm::m_HltStoreSvc [protected, inherited]
 

HltStoreSvc* IEFAlgorithm::m_HltStoreSvc [protected, inherited]
 

CriteriaItemValue* EFDetectorHits::m_nemc [private]
 

CriteriaItemValue* EFDetectorHits::m_nemc [private]
 

CriteriaItemValue* EFDetectorHits::m_nmdc [private]
 

CriteriaItemValue* EFDetectorHits::m_nmdc [private]
 

CriteriaItemValue* EFDetectorHits::m_nmuc [private]
 

CriteriaItemValue* EFDetectorHits::m_nmuc [private]
 

CriteriaItemValue* EFDetectorHits::m_ntof [private]
 

CriteriaItemValue* EFDetectorHits::m_ntof [private]
 

int IEFAlgorithm::m_output [protected, inherited]
 

PropertyMgr IEFAlgorithm::m_propMgr [protected, inherited]
 

IRawDataProviderSvc* IEFAlgorithm::m_rawDigiSvc [protected, inherited]
 

IRawDataProviderSvc* IEFAlgorithm::m_rawDigiSvc [protected, inherited]
 

CriteriaItemValue* EFDetectorHits::m_rndm [private]
 

CriteriaItemValue* EFDetectorHits::m_rndm [private]
 

bool IEFAlgorithm::m_run [protected, inherited]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:00:50 2011 for BOSS6.5.5 by  doxygen 1.3.9.1