| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

ChkMuon Class Reference

#include <ChkMuon.h>

Inheritance diagram for ChkMuon:

[legend]
Collaboration diagram for ChkMuon:
[legend]
List of all members.

Public Member Functions

 ChkMuon (const std::string &name, ISvcLocator *pSvcLocator)
 Check muon sample.
virtual ~ChkMuon ()
virtual StatusCode initialize ()
virtual StatusCode execute ()
virtual StatusCode finalize ()
virtual StatusCode sysExecute ()
void put (IDataProviderSvc *svc, DataObject *object, const std::string &address, const bool useRootInTES=true) const
void 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
bool registerContext () const
INTupleSvcevtColSvc () const
IAlgContextSvccontextSvc () 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
IUpdateManagerSvcupdMgrSvc () const
IDataProviderSvcfastContainersSvc () 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
MsgStreammsgStream (const MSG::Level level) const
MsgStreamalways () const
MsgStreamfatal () const
MsgStreamerr () const
MsgStreamerror () const
MsgStreamwarning () const
MsgStreaminfo () const
MsgStreamdebug () const
MsgStreamverbose () const
MsgStreammsg () const
const Statisticscounters () const
StatEntitycounter (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
unsigned long release ()
const std::string & context () const
const std::string & rootInTES () const
double globalTimeOffset () const
virtual StatusCode sysStart ()
virtual StatusCode sysInitialize ()
virtual StatusCode sysReinitialize ()
virtual StatusCode sysRestart ()
virtual StatusCode sysStop ()
virtual StatusCode sysFinalize ()
virtual StatusCode sysBeginRun ()
virtual StatusCode sysEndRun ()
virtual const std::string & name () const
virtual const std::string & version () const
virtual StatusCode configure ()
virtual StatusCode terminate ()
virtual StatusCode start ()
virtual StatusCode stop ()
virtual StatusCode reinitialize ()
virtual StatusCode restart ()
virtual bool isExecuted () const
virtual void setExecuted (bool state)
virtual void resetExecuted ()
virtual StatusCode beginRun ()
virtual StatusCode endRun ()
virtual Gaudi::StateMachine::State FSMState () const
virtual Gaudi::StateMachine::State targetFSMState () const
virtual bool isEnabled () const
virtual bool filterPassed () const
virtual void setFilterPassed (bool state)
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
void setOutputLevel (int level)
IAuditorSvcauditorSvc () const
IChronoStatSvcchronoSvc () const
IChronoStatSvcchronoStatService () const
IDataProviderSvcdetSvc () const
IDataProviderSvcdetDataService () const
IConversionSvcdetCnvSvc () const
IConversionSvcdetDataCnvService () const
IDataProviderSvceventSvc () const
IDataProviderSvcevtSvc () const
IDataProviderSvceventDataService () const
IConversionSvceventCnvSvc () const
IConversionSvceventDataCnvService () const
IHistogramSvchistoSvc () const
IHistogramSvchistogramDataService () const
IMessageSvcmsgSvc () const
IMessageSvcmessageService () const
INTupleSvcntupleSvc () const
INTupleSvcntupleService () const
IRndmGenSvcrandSvc () const
IToolSvctoolSvc () const
IExceptionSvcexceptionSvc () const
ISvcLocatorserviceLocator () const
ISvcLocatorsvcLoc () const
StatusCode createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg)
std::vector< Algorithm * > * subAlgorithms () const
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 PropertygetProperty (const std::string &name) const
virtual StatusCode getProperty (const std::string &n, std::string &v) const
virtual const std::vector<
Property * > & 
getProperties () const
StatusCode setProperties ()
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
IMonitorSvcmonitorSvc () 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
unsigned long addRef ()
StatusCode queryInterface (const InterfaceID &riid, void **)

Static Public Member Functions

static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()
static const InterfaceIDinterfaceID ()

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< ServiceEntryServices

Protected Member Functions

StatusCode releaseTool (const IAlgTool *tool) const
StatusCode releaseSvc (const IInterface *svc) const
bool isInitialized () const
bool isFinalized () const
int outputLevel () const
IntegerPropertyoutputLevelProperty ()
void initOutputLevel (Property &prop)

Static Protected Attributes

static const bool IgnoreRootInTES
static const bool UseRootInTES

Private Member Functions

StatusCode processGenHeader (const GenHeader *pGenHeader)
StatusCode processSimHeader (const SimHeader *pSimHeader)
StatusCode processHistory (const DayaBay::SimParticleHistory *pHist)

Private Attributes

MuonTreem_valiTree
 create a root tree
TimeStamp m_t0
 t0 of this set of data
SimTrackm_muon
 Primary muon track.
vector< SimTrack * > m_neutrons
IDetectorElementm_dbOws
 A few key detector elements, near site only -- db.
IDetectorElementm_dbOil1
IDetectorElementm_dbOil2
IDetectorElementm_dbLso1
IDetectorElementm_dbLso2

Detailed Description

Definition at line 27 of file ChkMuon.h.


Constructor & Destructor Documentation

ChkMuon::ChkMuon ( const std::string &  name,
ISvcLocator pSvcLocator 
)

Check muon sample.

Oct 5, 2009 created by Zhe Wang

Definition at line 30 of file ChkMuon.cc.

00030                                                                :
00031   GaudiAlgorithm(name, pSvcLocator)
00032 {
00033 }

ChkMuon::~ChkMuon (  )  [virtual]

Definition at line 35 of file ChkMuon.cc.

00036 {
00037 }


Member Function Documentation

StatusCode ChkMuon::initialize (  )  [virtual]

Reimplemented from GaudiAlgorithm.

Definition at line 39 of file ChkMuon.cc.

00040 {
00041   this->GaudiAlgorithm::initialize();
00042   
00044   m_dbOws = getDet<IDetectorElement>("/dd/Structure/Pool/db-ows");
00045   m_dbOil1 = getDet<IDetectorElement>("/dd/Structure/AD/db-oil1");
00046   m_dbOil2 = getDet<IDetectorElement>("/dd/Structure/AD/db-oil2");
00047   m_dbLso1 = getDet<IDetectorElement>("/dd/Structure/AD/db-lso1");
00048   m_dbLso2 = getDet<IDetectorElement>("/dd/Structure/AD/db-lso2");
00049 
00050   // init root tree
00051   m_valiTree=new MuonTree;
00052   m_valiTree->create();
00053 
00054   return StatusCode::SUCCESS;
00055 }

StatusCode ChkMuon::execute (  )  [virtual]

Reimplemented from GaudiAlgorithm.

Definition at line 57 of file ChkMuon.cc.

00058 {
00059   info()<<"Executing ... "<<endreq;
00060 
00061   StatusCode   sc;
00062   DataObject   *pObject;
00063 
00064   // get ReadoutHeader
00065   sc=eventSvc()->retrieveObject(SimHeader::defaultLocation(),pObject);
00066   if(sc.isFailure()) {
00067     debug()<<"No SimHeader for this event"<<endreq;
00068   }
00069 
00070   const GenHeader        *pGenHeader=0;
00071   const SimHeader        *pSimHeader=0;
00072 
00073   const IHeader* firstHeader=0;
00074 
00075   pSimHeader=dynamic_cast<SimHeader*>(pObject);
00076 
00077   // get the header object pointer of it lower stages
00078   // only the first one, for low event rate, it is enough
00079   if(pSimHeader!=0) {
00080     // GenHeader
00081     if(pSimHeader->inputHeaders().size() != 0) {
00082       firstHeader=*((pSimHeader->inputHeaders()).begin());
00083       pGenHeader= dynamic_cast<const GenHeader*>(firstHeader);
00084     }
00085   }  
00086 
00088   m_valiTree->reset();
00089 
00090   m_valiTree->evt = pSimHeader->execNumber();
00091 
00092   // then each header
00093   sc = processGenHeader(pGenHeader);
00094   if(sc.isFailure()) return StatusCode::FAILURE;
00095 
00096   sc = processSimHeader(pSimHeader);
00097   if(sc.isFailure()) return StatusCode::FAILURE;
00098 
00099   m_valiTree->fill();
00100   debug()<<"Leaving Execute()..."<<endreq;
00101 
00102   return StatusCode::SUCCESS;
00103 }

StatusCode ChkMuon::finalize (  )  [virtual]

Reimplemented from GaudiAlgorithm.

Definition at line 105 of file ChkMuon.cc.

00106 {
00107   m_valiTree->close();
00108   delete m_valiTree;
00109 
00110   return this->GaudiAlgorithm::finalize();
00111 }

StatusCode ChkMuon::processGenHeader ( const GenHeader pGenHeader  )  [private]

Definition at line 117 of file ChkMuon.cc.

00118 {
00119   // check GenHeader info if available                                                                           
00120   if( pGenHeader==0 ) {
00121     return StatusCode::SUCCESS;
00122   }
00123   info()<<"Processing GenHeader"<<endreq;
00124 
00125   // vertex                                                                                                                          
00126   const HepMC::GenEvent * pgevt = pGenHeader->event();
00127   const HepMC::GenVertex * pvtx = 0;
00128   const HepMC::GenParticle * pptl =0;
00129 
00130   debug()<<"vertices_size "<<pgevt->vertices_size()<<endreq;
00131   // There should be at least one vertex.                                                                                            
00132   // More than one vertex is also unlikely.                                                                                          
00133   if ( pgevt->vertices_size() != 1 ) {
00134     error()<<"More than one primary vertex, out of the scope of this analysing program."<<endreq;
00135     return StatusCode::FAILURE;
00136   }
00137   pvtx=*(pgevt->vertices_begin());
00138   debug()<<"vertex: "<<*pvtx<<endreq;
00139 
00140   // Only one primary particle                                                                                                       
00141   if ( pvtx->particles_out_size() != 1 ) {
00142     warning()<<"More than one primary particle, might be out of the scope of this analysing program."<<endreq;
00143     //return StatusCode::FAILURE;                                                                                                    
00144   }
00145   pptl=*(pvtx->particles_out_const_begin());
00146   debug()<<"particle: "<<*pptl<<endreq;
00147 
00148   // fill vertex position and time                                                                                                   
00149   // convert global point to local point with respect to ows
00150   Gaudi::XYZPoint globalP(pvtx->position().x(),
00151                           pvtx->position().y(),
00152                           pvtx->position().z());
00153 
00154   Gaudi::XYZPoint localP = m_dbOws->geometry()->toLocal(globalP);
00155 
00156   m_valiTree->trk1_x=localP.X();
00157   m_valiTree->trk1_y=localP.Y();
00158   m_valiTree->trk1_z=localP.Z();
00159   m_valiTree->trk1_r=sqrt((m_valiTree->trk1_x * m_valiTree->trk1_x) +
00160                           (m_valiTree->trk1_y * m_valiTree->trk1_y));
00161   // get t0 of this job                           
00162   static bool first=true;
00163   if(first) {
00164     first=false;
00165     m_t0=pGenHeader->earliest();  // get t0 of this run
00166     info()<<"t0 of this sample: "<<m_t0<<endreq;
00167   }
00168 
00169   // substract m_t0
00170   TimeStamp now=pGenHeader->earliest();
00171   TimeStamp dt=now-m_t0;  // get rid of m_t0                                                                                             
00172   m_valiTree->trk1_t=
00173     dt.GetSeconds()             // second                                                                                            
00174     +pvtx->position().t()/1e9;  // nano second -> second                                                                             
00175 
00176   debug()<<"now: "<<now<<"\t"<<"dt: "<<dt<<endreq;
00177   debug()<<"dt(s): "<<dt.GetSeconds()<<"\t"<<"t_vts(ns): "<<pvtx->position().t()<<endreq;
00178 
00179   // fill particle momentum                                                                                                          
00181   m_valiTree->trk1_px=pptl->momentum().px();
00182   m_valiTree->trk1_py=pptl->momentum().py();
00183   m_valiTree->trk1_pz=pptl->momentum().pz();
00184   m_valiTree->trk1_e=pptl->momentum().e();
00185 
00186 
00187   return StatusCode::SUCCESS;
00188 }

StatusCode ChkMuon::processSimHeader ( const SimHeader pSimHeader  )  [private]

Definition at line 194 of file ChkMuon.cc.

00195 {
00196   // check SimHeader info if available
00197   if( pSimHeader==0 ) {
00198     return StatusCode::SUCCESS;
00199   }
00200 
00201   info()<<"Processing SimHeader. analyze DayaBay site only!"<<endreq;
00202 
00205   const SimHitHeader* simhitheader = pSimHeader->hits();
00207   const SimHitHeader::hc_map& hcmap = simhitheader->hitCollection();
00208   SimHitHeader::hc_map::const_iterator it;
00209   
00211   debug()<<"size of hit collection "<< hcmap.size()<<endreq;
00212   for (it=hcmap.begin(); it != hcmap.end(); ++it) {
00213     
00214     Detector det(it->first);
00215     debug() << "Got hit collection from " << det.detName()<<" id= "
00216             << det.siteDetPackedData()<<endreq;
00217 
00219     const std::vector<SimHit*>& hitvec=it->second->collection();
00220     std::vector<SimHit*>::const_iterator it_hvec;
00221 
00222     if( det.detectorId() == DetectorId::kAD1 ) {
00223       debug() <<"AD1 has "<< hitvec.size()<<" hits"<<endreq;
00224       m_valiTree->nhits_AD1=hitvec.size();
00225 
00226     } else if ( det.detectorId() == DetectorId::kAD2 ) {
00227       debug() <<"AD2 has "<< hitvec.size()<<" hits"<<endreq;
00228       m_valiTree->nhits_AD2=hitvec.size();
00229 
00230     } else if ( det.detectorId() == DetectorId::kIWS ) {
00231       debug() <<"IWS has "<< hitvec.size()<<" hits"<<endreq;
00232       m_valiTree->nhits_IWS=hitvec.size();
00233 
00234     } else if ( det.detectorId() == DetectorId::kOWS ) {
00235       debug() <<"OWS has "<< hitvec.size()<<" hits"<<endreq;
00236       m_valiTree->nhits_OWS=hitvec.size();
00237 
00238     } else if ( det.detectorId() == DetectorId::kRPC ) {
00239       debug() <<"RPC has "<< hitvec.size()<<" hits"<<endreq;
00240       m_valiTree->nhits_RPC=hitvec.size();
00241     }
00242 
00243   } // loop over each hit collection
00244 
00245 
00247   // ------> get geant4 truth                                                                                                          
00248   // find the truch muon vertex in each AD                                                                                             
00249   const DayaBay::SimParticleHistory* pHist = pSimHeader->particleHistory();
00250 
00251   if(pHist) {
00252     processHistory(pHist);
00253   }
00254 
00255   //Get UnObservable Statistics info <<<<<<<<<<<<<----------
00256   const DayaBay::SimUnobservableStatisticsHeader* unobSt =
00257     pSimHeader->unobservableStatistics();
00258   const DayaBay::SimUnobservableStatisticsHeader::stat_map&
00259     statmap = unobSt->stats();
00260   DayaBay::SimUnobservableStatisticsHeader::stat_map::const_iterator
00261     st, stdone = statmap.end();
00262 
00263   debug()<<"UnObs size "<<statmap.size()<<endreq;
00264 
00265   if(unobSt) {
00266 
00267     for (st=statmap.begin(); st != stdone; ++st) {
00268 
00269       // Muon information
00270       // group 1, tot
00271       if(st->first=="TotDeInOil1")
00272         m_valiTree ->TotDeInOil1 = st->second.sum();
00273       if(st->first=="TotDeInOil2")
00274         m_valiTree ->TotDeInOil2 = st->second.sum();
00275       if(st->first=="TotDeInLso1")
00276         m_valiTree ->TotDeInLso1 = st->second.sum();
00277       if(st->first=="TotDeInLso2")
00278         m_valiTree ->TotDeInLso2 = st->second.sum();
00279 
00280       // group 2, muon track only
00281       if(st->first=="MuDeInOil1")
00282         m_valiTree ->MuDeInOil1 = st->second.sum();
00283       if(st->first=="MuDeInOil2")
00284         m_valiTree ->MuDeInOil2 = st->second.sum();
00285       if(st->first=="MuDeInLso1")
00286         m_valiTree ->MuDeInLso1 = st->second.sum();
00287       if(st->first=="MuDeInLso2")
00288         m_valiTree ->MuDeInLso2 = st->second.sum();
00289 
00290       // group 3, muon track dx
00291       if(st->first=="MuDxInOil1")
00292         m_valiTree ->MuDxInOil1 = st->second.sum();
00293       if(st->first=="MuDxInOil2")
00294         m_valiTree ->MuDxInOil2 = st->second.sum();
00295       if(st->first=="MuDxInLso1")
00296         m_valiTree ->MuDxInLso1 = st->second.sum();
00297       if(st->first=="MuDxInLso2")
00298         m_valiTree ->MuDxInLso2 = st->second.sum();
00299 
00300     }
00301   }
00302 
00303 
00304   return StatusCode::SUCCESS;
00305 } // end of pSimHeader

StatusCode ChkMuon::processHistory ( const DayaBay::SimParticleHistory pHist  )  [private]

Definition at line 309 of file ChkMuon.cc.

00310 {
00311   m_muon = 0;
00312   m_neutrons.clear();
00313 
00314   // tracks
00315   const std::list<DayaBay::SimTrack*>& trk=pHist->tracks();
00316   std::list<DayaBay::SimTrack*>::const_iterator tkci, tkEnd=trk.end();
00317 
00318   info()<<"History track list size "<<trk.size()<<endreq;
00319   for(tkci = trk.begin(); tkci != tkEnd; tkci++ ) {
00320     // Find primary muon
00321     if( (*tkci)->trackId() == 1 &&
00322         ( (*tkci)->particle() == 13 || (*tkci)->particle() == -13 ) &&
00323         (*tkci)->ancestorTrack().track() == 0 ) {
00324       m_muon = *tkci;
00325     }
00326 
00327     // Find neutron
00328     if( (*tkci)->particle() == 2112 ) {
00329       m_neutrons.push_back( *tkci );
00330     }
00331   }
00332   info()<<m_neutrons.size()<<" spallation neutron(s)"<<endreq;
00333   
00334   const std::list<DayaBay::SimVertex*>& vtx=pHist->vertices();
00335   std::list<DayaBay::SimVertex*>::const_iterator vtci, vtEnd=vtx.end();
00336   info()<<"History vertex list size "<<vtx.size()<<endreq;
00337 
00338   //  -------------------------------------------------------------------
00341   const vector<SimVertex*>& MuonVtx = m_muon->vertices();
00342   for( unsigned int ci=0; ci<MuonVtx.size(); ++ci )  {
00343     //    info()<<MuonVtx[ci]->position()<<endreq;
00344   }
00345 
00346   // convert global point of muon vertex to local point with respect to ows
00347   Gaudi::XYZPoint globalP = MuonVtx[0]->position();
00348   Gaudi::XYZPoint localP = m_dbOws->geometry()->toLocal(globalP);
00349 
00350   m_valiTree->his_t1 = MuonVtx[0]->time();
00351   m_valiTree->his_x1 = localP.x();
00352   m_valiTree->his_y1 = localP.y();
00353   m_valiTree->his_z1 = localP.z();
00354 
00355 
00356   //  -------------------------------------------------------------------
00358   int nMuonInducedNeutron = 0;
00359   int nInOws = 0;
00360   int nInOil1 = 0;
00361   int nInOil2 = 0;
00362   int nInLso1 = 0;
00363   int nInLso2 = 0;
00364 
00365   for( unsigned int nn=0; nn<m_neutrons.size(); ++nn )  {
00366     SimTrack* pNeu = m_neutrons[nn];
00367     const vector<SimVertex*>& NeuVtx = pNeu->vertices();
00368     
00369     info()<<"spallation neutron: "<<"track id "<<pNeu->trackId()<<" PDG id "<<pNeu->particle()
00370           <<" ancestor "<<pNeu->ancestorTrack().track()->trackId()<<" has "<<NeuVtx.size()<<" vertices."<<endreq;
00371 
00372     // The first and the last vertex for this neutron track
00373     SimVertex* FirstVtx = NeuVtx[0];
00374     SimVertex* LastVtx = NeuVtx[NeuVtx.size()-1];
00375     info()<<"  "<<FirstVtx->time()<<" "<<FirstVtx->position()<<" "<<FirstVtx->totalEnergy()<<" {"
00376           <<FirstVtx->process().type()<<" "<<FirstVtx->process().name()<<" }"<<endreq;
00377     info()<<"  "<<LastVtx->time()<<" "<<LastVtx->position()<<" "<<LastVtx->totalEnergy()<<" {"
00378           <<LastVtx->process().type()<<" "<<LastVtx->process().name()<<" }"<<endreq;
00379 
00380     if( pNeu->ancestorTrack().track()->trackId() != 1 )  {
00381       // Not produced by primary muon track, not interesting.
00382       info()<<"  Not induced by primary muon track"<<endreq;
00383       continue;
00384     }
00385 
00387     nMuonInducedNeutron += 1;
00389     globalP.SetZ( globalP.Z()-5000 );
00390     if( m_dbOws->geometry()->isInside( globalP ) )   info()<<"inside"<<endreq;
00391     info()<<"local point "<<m_dbOws->geometry()->toLocal( globalP )<<endreq;
00392 
00393     Gaudi::XYZPoint localP = m_dbOws->geometry()->toLocal( FirstVtx->position() );
00394     info()<<"local point of neutron vertex "<<localP<<endreq;
00395 
00396     if( m_dbOws->geometry()->isInside( FirstVtx->position() ) )  nInOws++;
00397     if( m_dbOil1->geometry()->isInside( FirstVtx->position() ) )  nInOil1++;
00398     if( m_dbOil2->geometry()->isInside( FirstVtx->position() ) )  nInOil2++;
00399     if( m_dbLso1->geometry()->isInside( FirstVtx->position() ) )  nInLso1++;
00400     if( m_dbLso2->geometry()->isInside( FirstVtx->position() ) )  nInLso2++;
00401     
00402     
00403     /*
00404     for( unsigned int ci=0; ci<NeuVtx.size(); ++ci )  {
00405       info()<<"  "<<NeuVtx[ci]->time()<<" "<<NeuVtx[ci]->position()<<" "<<NeuVtx[ci]->totalEnergy()<<" {"
00406             <<NeuVtx[ci]->process().type()<<" "<<NeuVtx[ci]->process().name()<<" }"<<endreq;
00407     }
00408     */
00409   }
00410 
00411   info()<<"Number of muon induced spallation neutrons: "<<nMuonInducedNeutron<<endreq;
00412   m_valiTree->nNeutron = nMuonInducedNeutron;
00413   m_valiTree->nInOws = nInOws;
00414   m_valiTree->nInOil1 = nInOil1;
00415   m_valiTree->nInOil2 = nInOil2;
00416   m_valiTree->nInLso1 = nInLso1;
00417   m_valiTree->nInLso2 = nInLso2;
00418 
00419 
00420   return StatusCode::SUCCESS;
00421 
00422 }


Member Data Documentation

MuonTree* ChkMuon::m_valiTree [private]

create a root tree

Definition at line 45 of file ChkMuon.h.

TimeStamp ChkMuon::m_t0 [private]

t0 of this set of data

Definition at line 48 of file ChkMuon.h.

SimTrack* ChkMuon::m_muon [private]

Primary muon track.

Definition at line 51 of file ChkMuon.h.

vector<SimTrack*> ChkMuon::m_neutrons [private]

Definition at line 52 of file ChkMuon.h.

IDetectorElement* ChkMuon::m_dbOws [private]

A few key detector elements, near site only -- db.

Definition at line 55 of file ChkMuon.h.

IDetectorElement* ChkMuon::m_dbOil1 [private]

Definition at line 56 of file ChkMuon.h.

IDetectorElement* ChkMuon::m_dbOil2 [private]

Definition at line 57 of file ChkMuon.h.

IDetectorElement* ChkMuon::m_dbLso1 [private]

Definition at line 58 of file ChkMuon.h.

IDetectorElement* ChkMuon::m_dbLso2 [private]

Definition at line 59 of file ChkMuon.h.


The documentation for this class was generated from the following files:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:34:58 2011 for MDC09b by doxygen 1.4.7