MCMonitorCosmicHistograms Class Reference

#include <MCMonitorCosmicHistograms.h>

List of all members.

Public Types

enum  EShieldFlag { kAll, kNoShield, kShieldOnly }

Public Member Functions

 MCMonitorCosmicHistograms (std::string name)
 ~MCMonitorCosmicHistograms ()
int NumHistograms (const TFolder *folder=0) const
string GetName () const
void FillHistograms (const NtpStRecord *strec, const NtpMCRecord *mcrec, const NtpSRRecord *srrec, const NtpTHRecord *threc)
void AllSumw2 (const TFolder *folder=0)
void SetCanRebin (const TFolder *folder=0)

Private Member Functions

void FillHistsTrue (std::string basepath, const NtpStRecord *strec, const NtpMCRecord *mcrec)
void FillTrueNumEvt (std::string truepath, int nmc)
void FillTrueNumStdHep (std::string truepath, int nstdhep)
void FillTrueNumDigiHit (std::string truepath, int ndigihit, std::string clause="")
void FillHistsTrueDigiHit (std::string truepath, const TClonesArray *digihitarray, std::string clause="")
void FillTrueDigiHitpId (std::string digihit, const NtpMCDigiScintHit &digihit, TH1F *hist1, std::string clause="")
void FillTrueDigiHitTrkId (std::string digihit, const NtpMCDigiScintHit &digihit, TH1F *hist1, std::string clause="")
void FillTrueDigiHitdE (std::string digihit, const NtpMCDigiScintHit &digihit, TH1F *hist1, std::string clause="")
void FillTrueDigiHitdS (std::string digihit, const NtpMCDigiScintHit &digihit, TH1F *hist1, std::string clause="")
void FillTrueDigiHitdSByEndPoints (std::string digihit, const NtpMCDigiScintHit &digihit, TH1F *hist1, std::string clause="")
void FillTrueDigiHitdSByEndPointsvsdS (std::string digihit, const NtpMCDigiScintHit &digihit, TProfile *prof, std::string clause="")
void FillTrueDigiHitdEdS (std::string digihit, const NtpMCDigiScintHit &digihit, TH1F *hist1, std::string clause="")
void FillTrueDigiHitdEdSByEndPoints (std::string digihit, const NtpMCDigiScintHit &digihit, TH1F *hist1, std::string clause="")
void FillTrueDigiHitdEdSvspE (std::string digihit, const NtpMCDigiScintHit &digihit, TProfile *prof, std::string clause="")
void FillTrueDigiHitdEdSByEndPointsvspE (std::string digihit, const NtpMCDigiScintHit &digihit, TProfile *prof, std::string clause="")
void FillHistsReTr (std::string basepath, const NtpStRecord *strec, const NtpMCRecord *mcrec, const NtpSRRecord *srrec, const NtpTHRecord *threc)
void FillHistsReTrTrk (std::string retrpath, const TClonesArray *stdheparray, const TClonesArray *trkarray, const TClonesArray *thtrkarray)
void FillReTrDelQPCurve (std::string partpath, const NtpMCStdHep &stdhep, const NtpSRTrack &trk, std::string clause)
void FillHistsReco (std::string basepath, const NtpStRecord *strec, const NtpSRRecord *srrec)
void FillHistsRecoStp (std::string recopath, const TClonesArray *stparray)
void FillRecoStpPerSnarl (std::string recopath, unsigned int nstrip)
void FillRecoStpEastPHPE (std::string recopath, const NtpSRStrip &stp, TH1F *hist1, std::string clause)
void FillRecoStpWestPHPE (std::string recopath, const NtpSRStrip &stp, TH1F *hist1, std::string clause)
void FillHistsRecoShw (std::string recopath, const TClonesArray *shwarray)
void FillRecoShwPerSnarl (std::string recopath, unsigned int nshower)
void FillRecoShwNumPlanes (std::string recopath, const NtpSRShower &shw)
void FillRecoShwEMGeV (std::string recopath, const NtpSRShower &shw)
void FillHistsRecoTrk (std::string recopath, const TClonesArray *trkarray)
void FillRecoTrkPerSnarl (std::string recopath, unsigned int ntrack)
void FillRecoTrkVtxDCosX (std::string recopath, const NtpSRTrack &trk, std::string partname="")
void FillRecoTrkVtxDCosY (std::string recopath, const NtpSRTrack &trk, std::string partname="")
void FillRecoTrkVtxDCosZ (std::string recopath, const NtpSRTrack &trk, std::string partname="")
void FillRecoTrkRange (std::string recopath, const NtpSRTrack &trk, std::string partname="")

Private Attributes

std::string fName
Detector::Detector_t fDetector
EShieldFlag fShieldFlag
Int_t fParticleId

Detailed Description

Definition at line 31 of file MCMonitorCosmicHistograms.h.


Member Enumeration Documentation

Enumerator:
kAll 
kNoShield 
kShieldOnly 

Definition at line 36 of file MCMonitorCosmicHistograms.h.

00036                    {
00037     // Used to determine if shield is included or not in plot quantities
00038     kAll,
00039     kNoShield,
00040     kShieldOnly
00041   };


Constructor & Destructor Documentation

MCMonitorCosmicHistograms::MCMonitorCosmicHistograms ( std::string  name  ) 

Definition at line 33 of file MCMonitorCosmicHistograms.cxx.

00034 : fName(name),fDetector(Detector::kUnknown),fShieldFlag(kAll),fParticleId(0) {
00035   // Default constructor
00036 
00037 }

MCMonitorCosmicHistograms::~MCMonitorCosmicHistograms (  ) 

Definition at line 40 of file MCMonitorCosmicHistograms.cxx.

00040                                                       {
00041   // Destructor
00042 
00043 }


Member Function Documentation

void MCMonitorCosmicHistograms::AllSumw2 ( const TFolder *  folder = 0  ) 

Definition at line 983 of file MCMonitorCosmicHistograms.cxx.

References fName, GetName(), and Lit::Print().

Referenced by MCMonitorCosmic::EndJob().

00983                                                                   {
00984   // Default argument null => start at base folder
00985   // sets default Poisson errors on all histograms
00986   
00987   if ( !baseFolder ) {
00988     HistMan hm(fName.c_str());
00989     const TFolder* folder = dynamic_cast<TFolder*>
00990                             (hm.BaseFolder().FindObject(fName.c_str()));
00991     if ( folder ) return AllSumw2(folder);
00992   }
00993   else {
00994     cout << "In AllSumw2 for folder " << baseFolder -> GetName() << endl;
00995 
00996     TCollection* objlist = baseFolder -> GetListOfFolders();
00997     TIter nextobj(objlist);
00998     TObject* obj = 0;
00999     while ( ( obj = (TObject*)nextobj() ) ) {
01000       cout << "Printing object" << endl;
01001       obj -> Print();
01002       TFolder* folder = dynamic_cast<TFolder*>(obj);
01003       if ( folder ) this -> AllSumw2(folder);
01004       else {
01005         TH1* hist = dynamic_cast<TH1*>(obj);
01006         if ( hist ) {
01007           TProfile* prof = dynamic_cast<TProfile*>(obj);
01008           if (!prof) hist -> Sumw2();
01009         }
01010       }
01011     }
01012   }
01013   
01014   return;
01015    
01016 }

void MCMonitorCosmicHistograms::FillHistograms ( const NtpStRecord strec,
const NtpMCRecord mcrec,
const NtpSRRecord srrec,
const NtpTHRecord threc 
)

Definition at line 46 of file MCMonitorCosmicHistograms.cxx.

References fDetector, FillHistsReco(), FillHistsReTr(), FillHistsTrue(), fName, VldContext::GetDetector(), and RecRecordImp< T >::GetVldContext().

00049                                                                          {
00050   // Public method to fill all histograms. Histograms created on first call.
00051 
00052   if (!strec && !mcrec && !srrec && !threc) return;
00053   
00054   // Set detector type
00055   const VldContext* vldc 
00056            = (strec)? strec->GetVldContext() : mcrec->GetVldContext();
00057   fDetector = vldc->GetDetector();
00058   
00059   std::string basepath = fName;
00060   FillHistsTrue(basepath,strec,mcrec);
00061   FillHistsReco(basepath,strec,srrec);
00062   FillHistsReTr(basepath,strec,mcrec,srrec,threc);
00063 
00064 }

void MCMonitorCosmicHistograms::FillHistsReco ( std::string  basepath,
const NtpStRecord strec,
const NtpSRRecord srrec 
) [private]

Definition at line 118 of file MCMonitorCosmicHistograms.cxx.

References FillHistsRecoShw(), FillHistsRecoStp(), FillHistsRecoTrk(), NtpStRecord::shw, NtpSRRecord::shw, NtpStRecord::stp, NtpSRRecord::stp, NtpStRecord::trk, and NtpSRRecord::trk.

Referenced by FillHistograms().

00120                                                                         {
00121   // Private method to fill all ../Reco/.. histograms
00122 
00123   if (!strec && !srrec) return;
00124   
00125   std::string recopath = basepath + "/Reco";
00126   
00127   // strip
00128   const TClonesArray* stparray = (strec) ? strec->stp: srrec->stp;
00129   FillHistsRecoStp(recopath,stparray);
00130   
00131   // shower
00132   const TClonesArray* shwarray = (strec) ? strec->shw : srrec->shw;
00133   FillHistsRecoShw(recopath,shwarray);
00134 
00135   // track
00136   const TClonesArray* trkarray = (strec) ? strec->trk : srrec->trk;
00137   FillHistsRecoTrk(recopath,trkarray);
00138 
00139   // event
00140   //const TClonesArray* evtarray = (strec) ? strec->evt : srrec->evt;
00141   //FillHistsRecoEvt(recopath,evtarray);
00142   
00143   
00144 }

void MCMonitorCosmicHistograms::FillHistsRecoShw ( std::string  recopath,
const TClonesArray *  shwarray 
) [private]

Definition at line 455 of file MCMonitorCosmicHistograms.cxx.

References FillRecoShwEMGeV(), FillRecoShwNumPlanes(), and FillRecoShwPerSnarl().

Referenced by FillHistsReco().

00456                                                                      {
00457   // Private method to fill all ../Reco/Shw* histograms
00458   
00459   if ( !shwarray ) return;
00460 
00461   HistMan hm(recopath.c_str());
00462 
00463   FillRecoShwPerSnarl(recopath,shwarray->GetEntriesFast());
00464   
00465   for ( int ishw = 0; ishw < shwarray->GetEntriesFast(); ishw++ ) {
00466     const NtpSRShower& shower 
00467              = *(dynamic_cast<NtpSRShower*>(shwarray->At(ishw)));
00468 
00469     FillRecoShwNumPlanes(recopath,shower);
00470     FillRecoShwEMGeV(recopath,shower);
00471     
00472   }
00473   
00474   return;
00475   
00476 }

void MCMonitorCosmicHistograms::FillHistsRecoStp ( std::string  recopath,
const TClonesArray *  stparray 
) [private]

Definition at line 213 of file MCMonitorCosmicHistograms.cxx.

References fDetector, FillRecoStpEastPHPE(), FillRecoStpPerSnarl(), FillRecoStpWestPHPE(), and NtpSRStrip::plane.

Referenced by FillHistsReco().

00214                                                                        {
00215   // Private method to fill ../Stp* histograms
00216   
00217   if ( !stparray ) return;
00218 
00219   HistMan hm(recopath.c_str());
00220 
00221   // For performance reasons, pre-read stp hists
00222   TH1F* eastphpe = 0;
00223   TH1F* westphpe = 0;
00224   FillRecoStpPerSnarl(recopath,stparray->GetEntriesFast());
00225   
00226   for ( int istp = 0; istp < stparray->GetEntriesFast(); istp++ ) {
00227     const NtpSRStrip& strip 
00228              = *(dynamic_cast<NtpSRStrip*>(stparray->At(istp)));
00229 
00230     if ( !eastphpe ) eastphpe = hm.Get<TH1F>("StpEastPHPE");
00231     if ( !westphpe ) westphpe = hm.Get<TH1F>("StpWestPHPE");
00232     
00233     // Determine if this is shield associated strip or not
00234     PlexPlaneId plexId(fDetector,strip.plane);
00235     bool isShield = plexId.IsVetoShield();
00236     if ( isShield ) continue;
00237 
00238     FillRecoStpEastPHPE(recopath,strip,eastphpe," (VS Excl) ");
00239     FillRecoStpWestPHPE(recopath,strip,westphpe," (VS Excl) ");
00240  
00241   }
00242 
00243   return;
00244   
00245 }

void MCMonitorCosmicHistograms::FillHistsRecoTrk ( std::string  recopath,
const TClonesArray *  trkarray 
) [private]

Definition at line 249 of file MCMonitorCosmicHistograms.cxx.

References FillRecoTrkPerSnarl(), FillRecoTrkRange(), FillRecoTrkVtxDCosX(), FillRecoTrkVtxDCosY(), and FillRecoTrkVtxDCosZ().

Referenced by FillHistsReco().

00250                                                                        {
00251   // Private method to fill all ../Reco/Trk* histograms
00252   
00253   if ( !trkarray ) return;
00254 
00255   HistMan hm(recopath.c_str());
00256   FillRecoTrkPerSnarl(recopath,trkarray->GetEntriesFast());
00257   
00258   for ( int itrk = 0; itrk < trkarray->GetEntriesFast(); itrk++ ) {
00259     const NtpSRTrack& track 
00260              = *(dynamic_cast<NtpSRTrack*>(trkarray->At(itrk)));
00261 
00262     FillRecoTrkVtxDCosX(recopath,track);
00263     FillRecoTrkVtxDCosY(recopath,track);
00264     FillRecoTrkVtxDCosZ(recopath,track);
00265     FillRecoTrkRange(recopath,track);
00266     
00267   }
00268   
00269   return;
00270   
00271 }

void MCMonitorCosmicHistograms::FillHistsReTr ( std::string  basepath,
const NtpStRecord strec,
const NtpMCRecord mcrec,
const NtpSRRecord srrec,
const NtpTHRecord threc 
) [private]

Definition at line 147 of file MCMonitorCosmicHistograms.cxx.

References FillHistsReTrTrk(), NtpStRecord::stdhep, NtpMCRecord::stdhep, NtpStRecord::thtrk, NtpTHRecord::thtrk, NtpStRecord::trk, and NtpSRRecord::trk.

Referenced by FillHistograms().

00151                                                                         {
00152   // Private method to fill all ../ReTr/.. histograms
00153 
00154   if (!strec && (!mcrec || !srrec || !threc) ) return;
00155   
00156   std::string retrpath = basepath + "/ReTr";
00157 
00158   // tracks
00159   const TClonesArray* stdheparray = (strec) ? strec->stdhep : mcrec->stdhep;
00160   const TClonesArray* trkarray = (strec) ? strec->trk : srrec->trk;
00161   const TClonesArray* thtrkarray = (strec) ? strec->thtrk : threc->thtrk;
00162   FillHistsReTrTrk(retrpath,stdheparray,trkarray,thtrkarray);
00163   
00164 }

void MCMonitorCosmicHistograms::FillHistsReTrTrk ( std::string  retrpath,
const TClonesArray *  stdheparray,
const TClonesArray *  trkarray,
const TClonesArray *  thtrkarray 
) [private]

Definition at line 167 of file MCMonitorCosmicHistograms.cxx.

References FillReTrDelQPCurve(), NtpMCStdHep::ParticleName(), and NtpTHTrack::trkstdhep.

Referenced by FillHistsReTr().

00170                                                                               {
00171   // Private method to fill all ../ReTr/(PartType)/Trk histograms
00172   
00173   if ( !stdheparray || !trkarray || !thtrkarray ) return;
00174   
00175   for (int itrk = 0; itrk < thtrkarray->GetEntriesFast(); itrk++) {
00176     NtpTHTrack* thtrk = dynamic_cast<NtpTHTrack*>(thtrkarray->At(itrk));
00177     Int_t istdhep = thtrk->trkstdhep;
00178     if ( istdhep < 0 ) continue; // truth helper failed to find match if true
00179     NtpMCStdHep* stdhep=dynamic_cast<NtpMCStdHep*>(stdheparray->At(istdhep));
00180     std::string partname = stdhep->ParticleName();
00181     std::string partpath = retrpath + "/" + partname;
00182     NtpSRTrack*  srtrk = dynamic_cast<NtpSRTrack*>(trkarray->At(itrk));
00183     std::string clause = " (" + partname + ")";
00184     FillReTrDelQPCurve(partpath,*stdhep,*srtrk,clause);
00185   }
00186 
00187 }

void MCMonitorCosmicHistograms::FillHistsTrue ( std::string  basepath,
const NtpStRecord strec,
const NtpMCRecord mcrec 
) [private]

Definition at line 67 of file MCMonitorCosmicHistograms.cxx.

References NtpMCRecord::digihit, NtpStRecord::digihit, FillHistsTrueDigiHit(), FillTrueNumDigiHit(), FillTrueNumEvt(), FillTrueNumStdHep(), fParticleId, fShieldFlag, kAll, kNoShield, kShieldOnly, NtpMCRecord::mchdr, NtpStRecord::mchdr, NtpMCSummary::ndigihit, NtpMCSummary::nmc, and NtpMCSummary::nstdhep.

Referenced by FillHistograms().

00069                                                                         {
00070   // Private method to fill all ../True/.. histograms
00071 
00072   if (!strec && !mcrec) return;
00073   
00074   std::string truepath = basepath + "/True";
00075   
00076   const NtpMCSummary& mchdr = (strec)? strec->mchdr : mcrec->mchdr;
00077   
00078   // mchdr
00079   FillTrueNumEvt(truepath,mchdr.nmc);
00080   FillTrueNumStdHep(truepath,mchdr.nstdhep);
00081   FillTrueNumDigiHit(truepath,mchdr.ndigihit);
00082 
00083   const TDatabasePDG& dbpdg = *(TDatabasePDG::Instance());
00084   const int npid = 5;
00085   int pidarray[npid] = {13,-13,11,-11,2212}; // mu-,mu+,e-,e+,p
00086   
00087   // digihit
00088   const TClonesArray* digihitarray 
00089                        = (strec) ? strec->digihit : mcrec->digihit;
00090   if ( digihitarray ) {
00091     // Fill first without shield hits
00092     fShieldFlag = kNoShield;
00093     fParticleId = 0;
00094     FillHistsTrueDigiHit(truepath+"/NoShield",digihitarray,
00095                         " (VS Excl)");
00096     // Now fill for each particle type of interest
00097     for ( int ipid = 0; ipid < npid; ipid++ ) {
00098       fParticleId = pidarray[ipid]; // mu+
00099       std::string partname = "???";
00100       if ( dbpdg.GetParticle(fParticleId) ) partname
00101                               = dbpdg.GetParticle(fParticleId)->GetName();
00102       std::string partpath = truepath+"/NoShield/"+partname;
00103       std::string clause = " (VS Excl) (" + partname + ")";
00104       FillHistsTrueDigiHit(partpath,digihitarray,clause);
00105     }
00106     
00107     // Fill next with shield hits only
00108     fParticleId = 0;
00109     fShieldFlag = kShieldOnly;
00110     FillHistsTrueDigiHit(truepath+"/ShieldOnly",digihitarray,
00111                                                " (VS Only)");
00112     fShieldFlag = kAll;
00113   }
00114   
00115 }

void MCMonitorCosmicHistograms::FillHistsTrueDigiHit ( std::string  truepath,
const TClonesArray *  digihitarray,
std::string  clause = "" 
) [private]

Definition at line 587 of file MCMonitorCosmicHistograms.cxx.

References fDetector, FillTrueDigiHitdE(), FillTrueDigiHitdEdS(), FillTrueDigiHitdEdSByEndPoints(), FillTrueDigiHitdEdSByEndPointsvspE(), FillTrueDigiHitdEdSvspE(), FillTrueDigiHitdS(), FillTrueDigiHitdSByEndPoints(), FillTrueDigiHitdSByEndPointsvsdS(), FillTrueNumDigiHit(), fParticleId, fShieldFlag, PlexPlaneId::IsVetoShield(), kNoShield, kShieldOnly, NtpMCDigiScintHit::pId, and NtpMCDigiScintHit::plane.

Referenced by FillHistsTrue().

00589                                                          {
00590   // Private method to fill all ../True/DigiHit/.. histograms
00591   
00592   if ( !digihitarray ) return;
00593   std::string digihitpath = truepath + "/DigiHit";
00594 
00595   HistMan hm(digihitpath.c_str());
00596   // For performance reasons, pre-read digihit hists
00597   TH1F* dshist1 = 0;
00598   TH1F* dsbyephist1 = 0;
00599   TProfile* dsbyepvsdsprof = 0;
00600   TH1F* dehist1 = 0;
00601   TH1F* dedshist1 = 0;
00602   TH1F* dedsbyephist1 = 0;
00603   TProfile* dedsvspeprof = 0;
00604   TProfile* dedsbyepvspeprof = 0;
00605   
00606   int ndigihit = 0;
00607   for ( int ihit = 0; ihit < digihitarray->GetEntriesFast(); ihit++ ) {
00608     const NtpMCDigiScintHit& digihit 
00609              = *(dynamic_cast<NtpMCDigiScintHit*>(digihitarray->At(ihit)));
00610 
00611     // Determine if this is shield associated hit or not
00612     PlexPlaneId plexId(fDetector,digihit.plane);
00613     bool isShield = plexId.IsVetoShield();
00614     if ( isShield && fShieldFlag == kNoShield ) continue;
00615     if ( !isShield && fShieldFlag == kShieldOnly ) continue;
00616     if ( fParticleId != 0 && digihit.pId != fParticleId ) continue;
00617     
00618     ndigihit++;
00619     
00620     if ( !dshist1 ) dshist1 = hm.Get<TH1F>("dS");
00621     if ( !dsbyephist1 ) dsbyephist1 = hm.Get<TH1F>("dSByEndPoints");
00622     if ( !dsbyepvsdsprof) dsbyepvsdsprof=hm.Get<TProfile>("dSByEndPointsvsdS");
00623     if ( !dehist1 ) dehist1 = hm.Get<TH1F>("dE");
00624     if ( !dedshist1 ) dedshist1 = hm.Get<TH1F>("dEdS");
00625     if ( !dedsbyephist1 ) dedsbyephist1 = hm.Get<TH1F>("dEdSByEndPoints");
00626     if ( !dedsvspeprof) dedsvspeprof = hm.Get<TProfile>("dEdSvspE");
00627     if ( !dedsbyepvspeprof) dedsbyepvspeprof = hm.Get<TProfile>("dEdSByEndPointsvspE");
00628 
00629     FillTrueDigiHitdS(digihitpath,digihit,dshist1,clause);
00630     FillTrueDigiHitdSByEndPoints(digihitpath,digihit,dsbyephist1,clause);
00631     FillTrueDigiHitdSByEndPointsvsdS(digihitpath,digihit,dsbyepvsdsprof,
00632                                      clause);
00633     FillTrueDigiHitdE(digihitpath,digihit,dehist1,clause);
00634     FillTrueDigiHitdEdS(digihitpath,digihit,dedshist1,clause);
00635     FillTrueDigiHitdEdSByEndPoints(digihitpath,digihit,dedsbyephist1,clause);
00636     FillTrueDigiHitdEdSvspE(digihitpath,digihit,dedsvspeprof,clause);
00637     FillTrueDigiHitdEdSByEndPointsvspE(digihitpath,digihit,dedsbyepvspeprof,
00638                                       clause);
00639 
00640   }
00641 
00642   FillTrueNumDigiHit(digihitpath,ndigihit,clause);
00643   
00644   return;
00645   
00646 }

void MCMonitorCosmicHistograms::FillRecoShwEMGeV ( std::string  recopath,
const NtpSRShower shw 
) [private]

Definition at line 498 of file MCMonitorCosmicHistograms.cxx.

References NtpSRShowerPulseHeight::EMgev, and NtpSRShower::shwph.

Referenced by FillHistsRecoShw().

00499                                                                          {
00500 
00501   // Private method to fill all ../ShwEMGeV histograms
00502 
00503   HistMan hm(recopath.c_str());
00504 
00505   TH1F* hist1 = hm.Get<TH1F>("ShwEMGeV");
00506   if ( !hist1 ) {
00507     hist1 = new TH1F("ShwEMGeV","Shw EM",40,0.,20.);
00508     hist1->SetXTitle("Shwr EM (GeV)");
00509     hist1->SetYTitle("Entries/0.5 GeV");
00510     hm.Adopt("",hist1);
00511   }
00512   
00513   hist1 -> Fill(shw.shwph.EMgev);
00514   
00515 }

void MCMonitorCosmicHistograms::FillRecoShwNumPlanes ( std::string  recopath,
const NtpSRShower shw 
) [private]

Definition at line 479 of file MCMonitorCosmicHistograms.cxx.

References NtpSRPlane::n, and NtpSRShower::plane.

Referenced by FillHistsRecoShw().

00480                                                                       {
00481   // Private method to fill all ../ShwNumPlanes histograms
00482 
00483   HistMan hm(recopath.c_str());
00484 
00485   TH1F* hist1 = hm.Get<TH1F>("ShwNumPlanes");
00486   if ( !hist1 ) {
00487     hist1 = new TH1F("ShwNumPlanes","Shw Num Planes",25,0.,50.);
00488     hist1->SetXTitle("Shwr Num Planes");
00489     hist1->SetYTitle("Entries/2");
00490     hm.Adopt("",hist1);
00491   }
00492   
00493   hist1 -> Fill(shw.plane.n);
00494   
00495 }

void MCMonitorCosmicHistograms::FillRecoShwPerSnarl ( std::string  recopath,
unsigned int  nshower 
) [private]

Definition at line 417 of file MCMonitorCosmicHistograms.cxx.

Referenced by FillHistsRecoShw().

00418                                                                           {
00419   // Private method to fill ../ShwPerSnarl histogram
00420 
00421   HistMan hm(recopath.c_str());
00422 
00423   TH1F* hist1 = hm.Get<TH1F>("ShwPerSnarl");
00424   if ( !hist1 ) {
00425     hist1 = new TH1F("ShwPerSnarl","shower per snarl",21,-0.5,20.5);
00426     hist1->SetXTitle("showers/snarl");
00427     hist1->SetYTitle("Entries/1");
00428     hm.Adopt("",hist1);
00429   }
00430   
00431   hist1 -> Fill(nshower);
00432                                               
00433 }

void MCMonitorCosmicHistograms::FillRecoStpEastPHPE ( std::string  recopath,
const NtpSRStrip stp,
TH1F *  hist1,
std::string  clause 
) [private]

Definition at line 274 of file MCMonitorCosmicHistograms.cxx.

References NtpSRStrip::ph0, and NtpSRPulseHeight::sigcor.

Referenced by FillHistsRecoStp().

00277                                                                       {
00278   // Private method to fill ../StpEastPHPE histogram
00279 
00280   if ( !hist1 ) {
00281     HistMan hm(recopath.c_str());
00282     hist1 = new TH1F("StpEastPHPE","Strip East PH",100,0.,2000.);
00283     std::string xtitle = "Strip East PH(PE)" + clause;
00284     hist1->SetXTitle(xtitle.c_str());
00285     hist1->SetYTitle("Entries/20 PE");
00286     hm.Adopt("",hist1);
00287   }
00288   
00289   hist1 -> Fill(stp.ph0.sigcor);
00290                                               
00291 }

void MCMonitorCosmicHistograms::FillRecoStpPerSnarl ( std::string  recopath,
unsigned int  nstrip 
) [private]

Definition at line 436 of file MCMonitorCosmicHistograms.cxx.

Referenced by FillHistsRecoStp().

00437                                                                          {
00438   // Private method to fill ../StpPerSnarl histogram
00439 
00440   HistMan hm(recopath.c_str());
00441 
00442   TH1F* hist1 = hm.Get<TH1F>("StpPerSnarl");
00443   if ( !hist1 ) {
00444     hist1 = new TH1F("StpPerSnarl","strip per snarl",100,-0.5,999.5);
00445     hist1->SetXTitle("strips/snarl");
00446     hist1->SetYTitle("Entries/1");
00447     hm.Adopt("",hist1);
00448   }
00449   
00450   hist1 -> Fill(nstrip);
00451                                               
00452 }

void MCMonitorCosmicHistograms::FillRecoStpWestPHPE ( std::string  recopath,
const NtpSRStrip stp,
TH1F *  hist1,
std::string  clause 
) [private]

Definition at line 294 of file MCMonitorCosmicHistograms.cxx.

References NtpSRStrip::ph1, and NtpSRPulseHeight::sigcor.

Referenced by FillHistsRecoStp().

00297                                                                       {
00298   // Private method to fill ../StpWestPHPE histogram
00299 
00300   if ( !hist1 ) {
00301     HistMan hm(recopath.c_str());
00302     hist1 = new TH1F("StpWestPHPE","Strip West PH",100,0.,2000.);
00303     std::string xtitle = "Strip West PH(PE)" + clause;
00304     hist1->SetXTitle(xtitle.c_str());
00305     hist1->SetYTitle("Entries/20 PE");
00306     hm.Adopt("",hist1);
00307   }
00308   
00309   hist1 -> Fill(stp.ph1.sigcor);
00310                                               
00311 }

void MCMonitorCosmicHistograms::FillRecoTrkPerSnarl ( std::string  recopath,
unsigned int  ntrack 
) [private]

Definition at line 398 of file MCMonitorCosmicHistograms.cxx.

Referenced by FillHistsRecoTrk().

00399                                                                          {
00400   // Private method to fill ../TrkPerSnarl histogram
00401 
00402   HistMan hm(recopath.c_str());
00403 
00404   TH1F* hist1 = hm.Get<TH1F>("TrkPerSnarl");
00405   if ( !hist1 ) {
00406     hist1 = new TH1F("TrkPerSnarl","track per snarl",21,-0.5,20.5);
00407     hist1->SetXTitle("tracks/snarl");
00408     hist1->SetYTitle("Entries/1");
00409     hm.Adopt("",hist1);
00410   }
00411   
00412   hist1 -> Fill(ntrack);
00413                                               
00414 }

void MCMonitorCosmicHistograms::FillRecoTrkRange ( std::string  recopath,
const NtpSRTrack trk,
std::string  partname = "" 
) [private]

Definition at line 377 of file MCMonitorCosmicHistograms.cxx.

References NtpSRTrack::ds.

Referenced by FillHistsRecoTrk().

00379                                                                          {
00380   // Private method to fill ../TrkRange histogram
00381 
00382   HistMan hm(recopath.c_str());
00383 
00384   TH1F* hist1 = hm.Get<TH1F>("TrkRange");
00385   if ( !hist1 ) {
00386     hist1 = new TH1F("TrkRange","reco trk range",64,0.,32.);
00387     std::string xtitle = particlename + " Reco Trk Range (m)";
00388     hist1->SetXTitle(xtitle.c_str());
00389     hist1->SetYTitle("Entries/0.5 m");
00390     hm.Adopt("",hist1);
00391   }
00392   
00393   hist1 -> Fill(trk.ds);
00394                                               
00395 }

void MCMonitorCosmicHistograms::FillRecoTrkVtxDCosX ( std::string  recopath,
const NtpSRTrack trk,
std::string  partname = "" 
) [private]

Definition at line 314 of file MCMonitorCosmicHistograms.cxx.

References NtpSRVertex::dcosx, and NtpSRTrack::vtx.

Referenced by FillHistsRecoTrk().

00316                                                                             {
00317   // Private method to fill ../TrkVtxDCosX histogram
00318 
00319   HistMan hm(recopath.c_str());
00320 
00321   TH1F* hist1 = hm.Get<TH1F>("TrkVtxDCosX");
00322   if ( !hist1 ) {
00323     hist1 = new TH1F("TrkVtxDCosX","reco trk vtx dcos(x)",40,-1.,1.);
00324     std::string xtitle = particlename + " Reco Trk Vtx DCos(X)";
00325     hist1->SetXTitle(xtitle.c_str());
00326     hist1->SetYTitle("Entries/0.05");
00327     hm.Adopt("",hist1);
00328   }
00329   
00330   hist1 -> Fill(trk.vtx.dcosx);
00331                                               
00332 }

void MCMonitorCosmicHistograms::FillRecoTrkVtxDCosY ( std::string  recopath,
const NtpSRTrack trk,
std::string  partname = "" 
) [private]

Definition at line 335 of file MCMonitorCosmicHistograms.cxx.

References NtpSRVertex::dcosy, and NtpSRTrack::vtx.

Referenced by FillHistsRecoTrk().

00337                                                                             {
00338   // Private method to fill all ../TrkVtxDCosY histogram
00339 
00340   HistMan hm(recopath.c_str());
00341 
00342   TH1F* hist1 = hm.Get<TH1F>("TrkVtxDCosY");
00343   if ( !hist1 ) {
00344     hist1 = new TH1F("TrkVtxDCosY","reco trk vtx dcos(y)",40,-1.,1.);
00345     std::string xtitle = particlename + " Reco Trk Vtx DCos(Y)";
00346     hist1->SetXTitle(xtitle.c_str());
00347     hist1->SetYTitle("Entries/0.05");
00348     hm.Adopt("",hist1);
00349   }
00350   
00351   hist1 -> Fill(trk.vtx.dcosy);
00352                                               
00353 }

void MCMonitorCosmicHistograms::FillRecoTrkVtxDCosZ ( std::string  recopath,
const NtpSRTrack trk,
std::string  partname = "" 
) [private]

Definition at line 356 of file MCMonitorCosmicHistograms.cxx.

References NtpSRVertex::dcosz, and NtpSRTrack::vtx.

Referenced by FillHistsRecoTrk().

00358                                                                             {
00359   // Private method to fill all ../TrkVtxDCosZ histograms
00360 
00361   HistMan hm(recopath.c_str());
00362 
00363   TH1F* hist1 = hm.Get<TH1F>("TrkVtxDCosZ");
00364   if ( !hist1 ) {
00365     hist1 = new TH1F("TrkVtxDCosZ","reco trk vtx dcos(z)",40,-1.,1.);
00366     std::string xtitle = particlename + " Reco Trk Vtx DCos(Z)";
00367     hist1->SetXTitle(xtitle.c_str());
00368     hist1->SetYTitle("Entries/0.05");
00369     hm.Adopt("",hist1);
00370   }
00371   
00372   hist1 -> Fill(trk.vtx.dcosz);
00373                                               
00374 }

void MCMonitorCosmicHistograms::FillReTrDelQPCurve ( std::string  partpath,
const NtpMCStdHep stdhep,
const NtpSRTrack trk,
std::string  clause 
) [private]

Definition at line 190 of file MCMonitorCosmicHistograms.cxx.

References NtpMCStdHep::Charge(), NtpSRTrack::momentum, NtpMCStdHep::P(), and NtpSRMomentum::qp.

Referenced by FillHistsReTrTrk().

00192                                               {
00193   // Private method to fill ../DelQPCurve histogram
00194 
00195   HistMan hm(partpath.c_str());
00196   TH1F* hist1 = hm.Get<TH1F>("DelQPCurve");
00197 
00198   if ( !hist1 ) {
00199     hist1 = new TH1F("DelQPCurve","[p/q - p/q(curvature)]",40,-100.,100.);
00200     std::string xtitle = "[p/q(true) - p/q(curvature)]"+clause;
00201     hist1->SetXTitle(xtitle.c_str());
00202     hist1->SetYTitle("Entries/5. GeV/c");
00203     hm.Adopt("",hist1);
00204   }
00205   
00206   double trkqp = (TMath::Abs(trk.momentum.qp) > 0.) ? (1/trk.momentum.qp) : 0;
00207   double stdhepqp = (stdhep.Charge() != 0 ) ? stdhep.P()/stdhep.Charge() : 0;
00208   hist1 -> Fill(stdhepqp - trkqp);
00209                                               
00210 }

void MCMonitorCosmicHistograms::FillTrueDigiHitdE ( std::string  digihit,
const NtpMCDigiScintHit digihit,
TH1F *  hist1,
std::string  clause = "" 
) [private]

Definition at line 730 of file MCMonitorCosmicHistograms.cxx.

References NtpMCDigiScintHit::dE, and Munits::MeV.

Referenced by FillHistsTrueDigiHit().

00732                                      {
00733   // Private method to fill ../DigiHit/dE
00734 
00735   if ( !hist1 ) {
00736     hist1 = new TH1F("dE","DigiHits Hit dE",100,0.,5.);
00737     std::string xtitle = "DigiHit dE (MeV)" + clause;
00738     hist1->SetXTitle(xtitle.c_str());
00739     hist1->SetYTitle("Entries/0.05 MeV");
00740     HistMan hm(digihitpath.c_str());
00741     hm.Adopt("",hist1);
00742   }
00743 
00744   hist1 -> Fill(digihit.dE/Munits::MeV);
00745 
00746 }

void MCMonitorCosmicHistograms::FillTrueDigiHitdEdS ( std::string  digihit,
const NtpMCDigiScintHit digihit,
TH1F *  hist1,
std::string  clause = "" 
) [private]

Definition at line 749 of file MCMonitorCosmicHistograms.cxx.

References Munits::cm, NtpMCDigiScintHit::dE, NtpMCDigiScintHit::dS, and Munits::MeV.

Referenced by FillHistsTrueDigiHit().

00751                                      {
00752   // Private method to fill ../DigiHit/dEdS histogram
00753 
00754   if ( !hist1 ) {
00755     hist1 = new TH1F("dEdS","DigiHits Hit dE/dS",100,0.,5.);
00756     std::string xtitle = "DigiHit dE/dS (MeV/cm)" + clause;
00757     hist1->SetXTitle(xtitle.c_str());
00758     hist1->SetYTitle("Entries/0.05 MeV/cm");
00759     HistMan hm(digihitpath.c_str());
00760     hm.Adopt("",hist1);
00761   }
00762 
00763   double dEdS = ( digihit.dS > 1.e-10 ) ?
00764     digihit.dE/Munits::MeV/(digihit.dS/Munits::cm) : 999.;
00765   
00766   hist1 -> Fill(dEdS);
00767 
00768 }

void MCMonitorCosmicHistograms::FillTrueDigiHitdEdSByEndPoints ( std::string  digihit,
const NtpMCDigiScintHit digihit,
TH1F *  hist1,
std::string  clause = "" 
) [private]

Definition at line 771 of file MCMonitorCosmicHistograms.cxx.

References Munits::cm, NtpMCDigiScintHit::dE, Munits::MeV, NtpMCDigiScintHit::x0, NtpMCDigiScintHit::x1, NtpMCDigiScintHit::y0, NtpMCDigiScintHit::y1, NtpMCDigiScintHit::z0, and NtpMCDigiScintHit::z1.

Referenced by FillHistsTrueDigiHit().

00773                                      {
00774   // Private method to fill ../DigiHit/dEdSByEndPoints histogram
00775 
00776   if ( !hist1 ) {
00777     hist1 = new TH1F("dEdSByEndPoints","DigiHits Hit dE/dS By EndPoints",
00778                                                             100,0.,5.);
00779     std::string xtitle = "DigiHit dE/dS_{linear} (MeV/cm)" + clause;
00780     hist1->SetXTitle(xtitle.c_str());
00781     hist1->SetYTitle("Entries/0.05 MeV/cm");
00782     HistMan hm(digihitpath.c_str());
00783     hm.Adopt("",hist1);
00784   }
00785 
00786   double dx = digihit.x1 - digihit.x0;
00787   double dy = digihit.y1 - digihit.y0;
00788   double dz = digihit.z1 - digihit.z0;
00789   double dsbyendpoints = sqrt(dx*dx+dy*dy+dz*dz);
00790 
00791   // for ds greater than a micron
00792   double dEdS = ( dsbyendpoints > 1.e-10 ) ?
00793     digihit.dE/Munits::MeV/(dsbyendpoints/Munits::cm) : 999.;
00794   
00795   hist1 -> Fill(dEdS);
00796 
00797 }

void MCMonitorCosmicHistograms::FillTrueDigiHitdEdSByEndPointsvspE ( std::string  digihit,
const NtpMCDigiScintHit digihit,
TProfile *  prof,
std::string  clause = "" 
) [private]

Definition at line 870 of file MCMonitorCosmicHistograms.cxx.

References Munits::cm, NtpMCDigiScintHit::dE, Msg::kWarning, Munits::MeV, MSG, NtpMCDigiScintHit::pE, NtpMCDigiScintHit::pId, NtpMCDigiScintHit::x0, NtpMCDigiScintHit::x1, NtpMCDigiScintHit::y0, NtpMCDigiScintHit::y1, NtpMCDigiScintHit::z0, and NtpMCDigiScintHit::z1.

Referenced by FillHistsTrueDigiHit().

00872                                         {
00873   // Private method to fill ../DigiHit/dEdSByEndPointsvspE profile
00874 
00875   if ( !prof ) { 
00876     prof = new TProfile("dEdSByEndPointsvspE",
00877                         "DigiHit dE/dx_{linear} vs log10(gamma*beta)",
00878                                                     40,-1.,3.,0.,50.,"");
00879     std::string xtitle = "log10(#gamma*#beta = p/Mc)" + clause;
00880     prof->SetXTitle(xtitle.c_str());
00881     prof->SetYTitle("DigiHit dE/dS (MeV/cm)");
00882     HistMan hm(digihitpath.c_str());
00883     hm.Adopt("",prof);
00884   }
00885 
00886   double dx = digihit.x1 - digihit.x0;
00887   double dy = digihit.y1 - digihit.y0;
00888   double dz = digihit.z1 - digihit.z0;
00889   double dsbyendpoints = sqrt(dx*dx+dy*dy+dz*dz);
00890 
00891   double dEdS = ( dsbyendpoints > 1.e-10 ) ?
00892     (digihit.dE/Munits::MeV)/(dsbyendpoints/Munits::cm) : -999.;
00893   if ( dEdS < 0 ) return;
00894   
00895   
00896   const TDatabasePDG& dbpdg = *(TDatabasePDG::Instance());
00897   TParticlePDG* particle = dbpdg.GetParticle(digihit.pId);
00898   if ( !particle ) {
00899     MSG("MCMon",Msg::kWarning) << "In FillTrueDigiHitdEdSByEndPointsvspE:\n"
00900                                << "No particle of type " << digihit.pId
00901                                << " in PDG database. Skipped hit." << endl;
00902     return;
00903   }
00904   
00905   Double_t partmass = particle->Mass();
00906  
00907   Double_t betagamma2 = pow(digihit.pE/partmass,2) - 1.;
00908   if ( betagamma2 < 0. ) return; // precision errors
00909   
00910   Double_t log10betagamma = log10(sqrt(betagamma2));
00911   
00912   prof -> Fill(log10betagamma,dEdS);
00913 
00914 }

void MCMonitorCosmicHistograms::FillTrueDigiHitdEdSvspE ( std::string  digihit,
const NtpMCDigiScintHit digihit,
TProfile *  prof,
std::string  clause = "" 
) [private]

Definition at line 824 of file MCMonitorCosmicHistograms.cxx.

References Munits::cm, NtpMCDigiScintHit::dE, NtpMCDigiScintHit::dS, Msg::kWarning, Munits::MeV, MSG, NtpMCDigiScintHit::pE, and NtpMCDigiScintHit::pId.

Referenced by FillHistsTrueDigiHit().

00826                                         {
00827   // Private method to fill ../DigiHit/dEdSvspE profile
00828 
00829   if ( !prof ) { 
00830     prof = new TProfile("dEdSvspE","DigiHit dE/dx vs log10(gamma*beta)",
00831                                                     40,-1.,3.,0.,50.,"");
00832     std::string xtitle = "log10(#gamma*#beta = p/Mc)" + clause;
00833     prof->SetXTitle(xtitle.c_str());
00834     prof->SetYTitle("DigiHit dE/dS (MeV/cm)");
00835     HistMan hm(digihitpath.c_str());
00836     hm.Adopt("",prof);
00837   }
00838 
00839   double dEdS = ( digihit.dS > 1.e-10 ) ?
00840     (digihit.dE/Munits::MeV)/(digihit.dS/Munits::cm) : -999.;
00841   if ( dEdS < 0 ) return;
00842   
00843   //cout << "dE " << digihit.dE << " dS " << digihit.dS 
00844   //      << " dEdS (MeV/cm)" << dEdS << endl;
00845   
00846   const TDatabasePDG& dbpdg = *(TDatabasePDG::Instance());
00847   TParticlePDG* particle = dbpdg.GetParticle(digihit.pId);
00848   if ( !particle ) {
00849     MSG("MCMon",Msg::kWarning) << "In FillTrueDigiHitdEdSvspE:\n"
00850                                << "No particle of type " << digihit.pId
00851                                << " in PDG database. Skipped hit." << endl;
00852     return;
00853   }
00854   
00855   Double_t partmass = particle->Mass();
00856   //cout << "partmass " << partmass << endl;
00857   //cout << "digihit.pE " << digihit.pE << endl;
00858  
00859   Double_t betagamma2 = pow(digihit.pE/partmass,2) - 1.;
00860   if ( betagamma2 < 0. ) return; // precision errors
00861   
00862   Double_t log10betagamma = log10(sqrt(betagamma2));
00863   //cout << "log10(beta*gamma) " << log10betagamma << endl;
00864   
00865   prof -> Fill(log10betagamma,dEdS);
00866 
00867 }

void MCMonitorCosmicHistograms::FillTrueDigiHitdS ( std::string  digihit,
const NtpMCDigiScintHit digihit,
TH1F *  hist1,
std::string  clause = "" 
) [private]

Definition at line 687 of file MCMonitorCosmicHistograms.cxx.

References Munits::cm, and NtpMCDigiScintHit::dS.

Referenced by FillHistsTrueDigiHit().

00689                                      {
00690   // Private method to fill ../DigiHit/dS histogram
00691 
00692   if ( !hist1 ) {
00693     hist1 = new TH1F("dS","DigiHits Hit dS",150,0.,5.);
00694     std::string xtitle = "DigiHit dS (cm)" + clause;
00695     hist1->SetXTitle(xtitle.c_str());
00696     hist1->SetYTitle("Entries/0.033 cm");
00697     HistMan hm(digihitpath.c_str());
00698     hm.Adopt("",hist1);
00699   }
00700 
00701   hist1 -> Fill(digihit.dS/Munits::cm);
00702 
00703 }

void MCMonitorCosmicHistograms::FillTrueDigiHitdSByEndPoints ( std::string  digihit,
const NtpMCDigiScintHit digihit,
TH1F *  hist1,
std::string  clause = "" 
) [private]

Definition at line 706 of file MCMonitorCosmicHistograms.cxx.

References Munits::cm, NtpMCDigiScintHit::x0, NtpMCDigiScintHit::x1, NtpMCDigiScintHit::y0, NtpMCDigiScintHit::y1, NtpMCDigiScintHit::z0, and NtpMCDigiScintHit::z1.

Referenced by FillHistsTrueDigiHit().

00708                                      {
00709   // Private method to fill ../DigiHit/dS histogram
00710 
00711   if ( !hist1 ) {
00712     hist1 = new TH1F("dSByEndPoints","DigiHits dS by EndPoints",150,0.,5.);
00713     std::string xtitle = "DigiHit dS_{linear} (cm)" + clause;
00714     hist1->SetXTitle(xtitle.c_str());
00715     hist1->SetYTitle("Entries/0.033 cm");
00716     HistMan hm(digihitpath.c_str());
00717     hm.Adopt("",hist1);
00718   }
00719 
00720   double dx = digihit.x1 - digihit.x0;
00721   double dy = digihit.y1 - digihit.y0;
00722   double dz = digihit.z1 - digihit.z0;
00723   double dsbyendpoints = sqrt(dx*dx+dy*dy+dz*dz)/Munits::cm;
00724 
00725   hist1 -> Fill(dsbyendpoints);
00726 
00727 }

void MCMonitorCosmicHistograms::FillTrueDigiHitdSByEndPointsvsdS ( std::string  digihit,
const NtpMCDigiScintHit digihit,
TProfile *  prof,
std::string  clause = "" 
) [private]

Definition at line 800 of file MCMonitorCosmicHistograms.cxx.

References Munits::cm, NtpMCDigiScintHit::dS, NtpMCDigiScintHit::x0, NtpMCDigiScintHit::x1, NtpMCDigiScintHit::y0, NtpMCDigiScintHit::y1, NtpMCDigiScintHit::z0, and NtpMCDigiScintHit::z1.

Referenced by FillHistsTrueDigiHit().

00802                                         {
00803   // Private method to fill ../DigiHit/dEdSvspE profile
00804 
00805   if ( !prof ) { 
00806     prof = new TProfile("dSByEndPointsvsdS","DigiHit dSByEndPoints vs dS",
00807                                                     150,0.,5.,0.,5.,"");
00808     std::string xtitle = "dS (cm)" + clause;
00809     prof->SetXTitle(xtitle.c_str());
00810     prof->SetYTitle("dS_{linear} (cm)");
00811     HistMan hm(digihitpath.c_str());
00812     hm.Adopt("",prof);
00813   }
00814 
00815   double dx = digihit.x1 - digihit.x0;
00816   double dy = digihit.y1 - digihit.y0;
00817   double dz = digihit.z1 - digihit.z0;
00818   double dsbyendpoints = sqrt(dx*dx+dy*dy+dz*dz)/Munits::cm;
00819   prof -> Fill(digihit.dS/Munits::cm,dsbyendpoints);
00820 
00821 }

void MCMonitorCosmicHistograms::FillTrueDigiHitpId ( std::string  digihit,
const NtpMCDigiScintHit digihit,
TH1F *  hist1,
std::string  clause = "" 
) [private]

Definition at line 649 of file MCMonitorCosmicHistograms.cxx.

References NtpMCDigiScintHit::pId.

00651                                      {
00652   // Private method to fill ../DigiHit/pId histogram
00653 
00654   if ( !hist1 ) {
00655     hist1 = new TH1F("pId","DigiHit Particle Id",5000,-2500.,2500.);
00656     std::string xtitle = "DigiHit Particle Id" + clause;
00657     hist1->SetXTitle(xtitle.c_str());
00658     hist1->SetYTitle("Entries/1");
00659     HistMan hm(digihitpath.c_str());
00660     hm.Adopt("",hist1);
00661   }
00662   
00663   hist1 -> Fill(digihit.pId);
00664 
00665 }

void MCMonitorCosmicHistograms::FillTrueDigiHitTrkId ( std::string  digihit,
const NtpMCDigiScintHit digihit,
TH1F *  hist1,
std::string  clause = "" 
) [private]

Definition at line 668 of file MCMonitorCosmicHistograms.cxx.

References NtpMCDigiScintHit::trkId.

00670                                      {
00671   // Private method to fill ../DigiHit/TrkId histogram
00672 
00673   if ( !hist1 ) {
00674     hist1 = new TH1F("TrkId","DigiHit StdHep Array Index",200,-100.,100.);
00675     std::string xtitle = "DigiHit StdHep Array Index" + clause;
00676     hist1->SetXTitle(xtitle.c_str());
00677     hist1->SetYTitle("Entries/1");
00678     HistMan hm(digihitpath.c_str());
00679     hm.Adopt("",hist1);
00680   }
00681   
00682   hist1 -> Fill(digihit.trkId);
00683 
00684 }

void MCMonitorCosmicHistograms::FillTrueNumDigiHit ( std::string  truepath,
int  ndigihit,
std::string  clause = "" 
) [private]

Definition at line 556 of file MCMonitorCosmicHistograms.cxx.

References fParticleId.

Referenced by FillHistsTrue(), and FillHistsTrueDigiHit().

00557                                                                       {
00558   // Private method to fill ../True/NumDigiHitPerSnarl 
00559   
00560   HistMan hm(truepath.c_str());
00561 
00562   TH1F* hist1 = hm.Get<TH1F>("NumDigiHitPerSnarl");
00563   if ( !hist1 ) {
00564     Float_t maxrange = 10000;
00565     Int_t nbin = 50;
00566     if ( fParticleId == -13 || fParticleId == 13 || fParticleId == -11 ) 
00567                                              { maxrange=250; nbin=50; }
00568     //if ( fParticleId == 2212 ) { maxrange = 10; nbin = 40; }
00569     
00570     hist1 = new TH1F("NumDigiHitPerSnarl","Num DigiHit/Snarl",nbin,
00571                                                       0.,maxrange);
00572     std::string xtitle = "Num DigiHits/Snarl" + clause;
00573     hist1->SetXTitle(xtitle.c_str());
00574     Float_t binwidth = maxrange/nbin;
00575     std::ostringstream oss;
00576     oss << std::dec << binwidth;
00577     std::string ytitle = "Entries/"+oss.str();
00578     hist1->SetYTitle(ytitle.c_str());
00579     hm.Adopt("",hist1);
00580   }
00581   
00582   hist1 -> Fill(ndigihit);
00583   
00584 }

void MCMonitorCosmicHistograms::FillTrueNumEvt ( std::string  truepath,
int  nmc 
) [private]

Definition at line 518 of file MCMonitorCosmicHistograms.cxx.

Referenced by FillHistsTrue().

00519                                                         {
00520   // Private method to fill ../True/NumEvtPerSnarl 
00521   
00522   HistMan hm(truepath.c_str());
00523 
00524   TH1F* hist1 = hm.Get<TH1F>("NumEvtPerSnarl");
00525   if ( !hist1 ) {
00526     hist1 = new TH1F("NumEvtPerSnarl","True Num Evt/Snarl",60,0.,60.);
00527     hist1->SetXTitle("True Num Evt/Snarl");
00528     hist1->SetYTitle("Entries/1");
00529     hm.Adopt("",hist1);
00530   }
00531   
00532   hist1 -> Fill(nmc);
00533   
00534 }

void MCMonitorCosmicHistograms::FillTrueNumStdHep ( std::string  truepath,
int  nstdhep 
) [private]

Definition at line 537 of file MCMonitorCosmicHistograms.cxx.

Referenced by FillHistsTrue().

00538                                                                {
00539   // Private method to fill ../True/NumStdHepPerSnarl 
00540   
00541   HistMan hm(truepath.c_str());
00542 
00543   TH1F* hist1 = hm.Get<TH1F>("NumStdHepPerSnarl");
00544   if ( !hist1 ) {
00545     hist1 = new TH1F("NumStdHepPerSnarl","Num StdHep/Snarl",50,0.,100.);
00546     hist1->SetXTitle("Num StdHep/Snarl");
00547     hist1->SetYTitle("Entries/2");
00548     hm.Adopt("",hist1);
00549   }
00550   
00551   hist1 -> Fill(nstdhep);
00552   
00553 }

string MCMonitorCosmicHistograms::GetName ( void   )  const [inline]

Definition at line 48 of file MCMonitorCosmicHistograms.h.

References fName.

Referenced by AllSumw2(), MCMonitorCosmic::EndJob(), NumHistograms(), and SetCanRebin().

00048 { return fName; } // name for this collection

int MCMonitorCosmicHistograms::NumHistograms ( const TFolder *  folder = 0  )  const

Definition at line 918 of file MCMonitorCosmicHistograms.cxx.

References fName, GetName(), and Lit::Print().

Referenced by MCMonitorCosmic::EndJob().

00918                                                                             {
00919   // Default argument null => start at base folder
00920   // number of histograms in the class
00921   
00922   int numHist = 0;
00923   
00924   if ( !baseFolder ) {
00925     HistMan hm(fName.c_str());
00926     const TFolder* folder = dynamic_cast<TFolder*>
00927                             (hm.BaseFolder().FindObject(fName.c_str()));
00928     if ( folder ) return NumHistograms(folder);
00929   }
00930   else {
00931     cout << "In NumHistograms for folder " << baseFolder -> GetName() << endl;
00932 
00933     TCollection* objlist = baseFolder -> GetListOfFolders();
00934     TIter nextobj(objlist);
00935     TObject* obj = 0;
00936     while ( ( obj = (TObject*)nextobj() ) ) {
00937       cout << "Printing object" << endl;
00938       obj -> Print();
00939       TFolder* folder = dynamic_cast<TFolder*>(obj);
00940       if ( folder ) numHist += this -> NumHistograms(folder);
00941       else numHist++;
00942     }
00943   }
00944   
00945   return numHist;
00946    
00947 }

void MCMonitorCosmicHistograms::SetCanRebin ( const TFolder *  folder = 0  ) 

Definition at line 950 of file MCMonitorCosmicHistograms.cxx.

References fName, GetName(), and Lit::Print().

Referenced by MCMonitorCosmic::EndJob().

00950                                                                      {
00951   // Default argument null => start at base folder
00952   // Set all the histograms so they can be rebinned by the user by default
00953 
00954   if ( !baseFolder ) {
00955     HistMan hm(fName.c_str());
00956     const TFolder* folder = dynamic_cast<TFolder*>
00957                             (hm.BaseFolder().FindObject(fName.c_str()));
00958     if ( folder ) return SetCanRebin(folder);
00959   }
00960   else {
00961     cout << "In SetCanRebin for folder " << baseFolder -> GetName() << endl;
00962 
00963     TCollection* objlist = baseFolder -> GetListOfFolders();
00964     TIter nextobj(objlist);
00965     TObject* obj = 0;
00966     while ( ( obj = (TObject*)nextobj() ) ) {
00967       cout << "Printing object" << endl;
00968       obj -> Print();
00969       TFolder* folder = dynamic_cast<TFolder*>(obj);
00970       if ( folder ) this -> SetCanRebin(folder);
00971       else {
00972         TH1* hist = dynamic_cast<TH1*>(obj);
00973         hist -> SetBit(TH1::kCanRebin);
00974       }
00975     }
00976   }
00977   
00978   return;
00979    
00980 }


Member Data Documentation

std::string MCMonitorCosmicHistograms::fName [private]

Definition at line 150 of file MCMonitorCosmicHistograms.h.

Referenced by FillHistsTrue(), and FillHistsTrueDigiHit().


The documentation for this class was generated from the following files:

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1