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

NtpMCRecord Class Reference

#include <NtpMCRecord.h>

Inheritance diagram for NtpMCRecord:

RecRecordImp< RecCandHeader > RecRecord List of all members.

Public Member Functions

 NtpMCRecord ()
 NtpMCRecord (const RecCandHeader &header)
virtual ~NtpMCRecord ()
virtual std::ostream & Print (std::ostream &os) const
virtual void Print (const Option_t *option="") const
void Clear (Option_t *option="")

Public Attributes

NtpMCSummary mchdr
NtpMCPhotonResult photon
NtpMCDetSimResult detsim
TClonesArray * mc
TClonesArray * stdhep
TClonesArray * flsdigit
TClonesArray * digihit

Private Member Functions

void Init ()

Constructor & Destructor Documentation

NtpMCRecord::NtpMCRecord  ) 
 

Definition at line 25 of file NtpMCRecord.cxx.

References MSG.

00025                          : RecRecordImp<RecCandHeader>(),mc(0),stdhep(0),
00026                              flsdigit(0),digihit(0) {
00027   // Purpose: Default constructor
00028   MSG("NtpMC",Msg::kVerbose) << "NtpMCRecord def ctor @ " << this << endl;
00029   this -> Init();  
00030 }

NtpMCRecord::NtpMCRecord const RecCandHeader header  ) 
 

Definition at line 32 of file NtpMCRecord.cxx.

References Init(), and MSG.

00032                                                  : 
00033   RecRecordImp<RecCandHeader>(hdr),mc(0),stdhep(0),flsdigit(0),digihit(0) {
00034   // Purpose: Normal constructor
00035 
00036   MSG("NtpMC",Msg::kVerbose) << "NtpMCRecord normal ctor @ " << this << endl;
00037   this -> Init(); 
00038 }

NtpMCRecord::~NtpMCRecord  )  [virtual]
 

Definition at line 40 of file NtpMCRecord.cxx.

References digihit, flsdigit, RecArrayAllocator::Instance(), mc, MSG, RecArrayAllocator::ReleaseArray(), and stdhep.

00040                           {
00041   // Purpose: Destructor
00042 
00043   MSG("NtpMC",Msg::kVerbose) << "NtpMCRecord dtor @ " << this << endl;
00044   
00045   // Release arrays back to TClonesArray pool for reuse
00046   // Allocated memory of stored objects is retrieved via object Clear call
00047   RecArrayAllocator& allocator = RecArrayAllocator::Instance();
00048   if ( mc ) { allocator.ReleaseArray(mc); mc = 0; }
00049   if ( stdhep ) { allocator.ReleaseArray(stdhep); stdhep = 0; }
00050   if ( flsdigit ) { allocator.ReleaseArray(flsdigit); flsdigit = 0; }
00051   if ( digihit ) { allocator.ReleaseArray(digihit); digihit = 0; }
00052   
00053 }


Member Function Documentation

void NtpMCRecord::Clear Option_t *  option = ""  ) 
 

Definition at line 55 of file NtpMCRecord.cxx.

References NtpMCDetSimResult::Clear(), detsim, digihit, flsdigit, mc, and stdhep.

00055                                               {
00056   // Purpose: Clear memory allocated to arrays so that record can
00057   // be reused.  
00058 
00059   detsim.Clear();
00060   if ( mc ) { mc -> Clear("C"); }
00061   if ( stdhep ) { stdhep -> Clear("C"); }
00062   if ( flsdigit ) { flsdigit -> Clear("C"); }
00063   if ( digihit ) { digihit -> Clear("C"); }
00064 }

void NtpMCRecord::Init  )  [private]
 

Definition at line 66 of file NtpMCRecord.cxx.

References digihit, flsdigit, RecArrayAllocator::GetArray(), RecArrayAllocator::Instance(), mc, RecRecordImp< RecCandHeader >::SetClearable(), and stdhep.

Referenced by NtpMCRecord().

00066                        {
00067   // 
00068   // Purpose: Initialize ntuple TClonesArrays
00069   //
00070 
00071   // Set variable in record base class to indicate that it is possible
00072   // to recover dynamic memory using Clear() method for this record type
00073   SetClearable(true);
00074 
00075   RecArrayAllocator& allocator = RecArrayAllocator::Instance();
00076   if ( !mc ) mc = allocator.GetArray("NtpMCTruth");
00077   if ( !stdhep ) stdhep = allocator.GetArray("NtpMCStdHep");
00078   if ( !flsdigit ) flsdigit = allocator.GetArray("NtpMCFLSDigit");
00079   if ( !digihit ) digihit = allocator.GetArray("NtpMCDigiScintHit");
00080 }

void NtpMCRecord::Print const Option_t *  option = ""  )  const [virtual]
 

Definition at line 117 of file NtpMCRecord.cxx.

References Print().

00117                                                           {
00118   //
00119   // Purpose: Print record in form supported by TObject::Print
00120   //
00121 
00122   Print(std::cout);
00123   return;
00124 
00125 }

std::ostream & NtpMCRecord::Print std::ostream &  os  )  const [virtual]
 

Reimplemented from RecRecordImp< RecCandHeader >.

Definition at line 82 of file NtpMCRecord.cxx.

References mc, mchdr, NtpMCStdHep::parent, NtpMCStdHep::Print(), NtpMCSummary::Print(), RecRecordImp< T >::Print(), and stdhep.

Referenced by Print().

00082                                                    {
00083   //
00084   // Purpose: Print status of ntuple record on ostream
00085   //
00086 
00087   os << "NtpMCRecord::Print" << endl;
00088   RecRecordImp<RecCandHeader>::Print(os);
00089   mchdr.Print(os);
00090   if ( mc ) {
00091     for ( int imc = 0; imc < mc->GetLast()+1; imc++ ) {
00092       (dynamic_cast<NtpMCTruth*>(mc -> At(imc))) -> Print(os);
00093     }
00094   }
00095   if ( stdhep ) {
00096     Int_t nstdhep = stdhep->GetLast()+1;
00097     std::string entrystr = " entries:";
00098     if ( nstdhep == 1 ) entrystr = " entry:";
00099 
00100     os << "\nPrint stdhep array of NtpMCStdHep w/"
00101        << nstdhep << entrystr.c_str() << endl;
00102     for ( int istd = 0; istd < nstdhep; istd++ ) {
00103       const NtpMCStdHep* ntpstdhep
00104         = dynamic_cast<const NtpMCStdHep*>(stdhep->At(istd));
00105       if ( ntpstdhep->parent[0] == -1 ) 
00106         ntpstdhep->Print(std::cout,"","",stdhep);
00107     }
00108   }
00109   else {
00110     os << "Null stdhep array." << endl;
00111   }
00112   
00113   return os;
00114 
00115 }


Member Data Documentation

NtpMCDetSimResult NtpMCRecord::detsim
 

Definition at line 50 of file NtpMCRecord.h.

Referenced by Clear(), and NtpMCModule::Reco().

TClonesArray* NtpMCRecord::digihit
 

Definition at line 54 of file NtpMCRecord.h.

Referenced by Clear(), MCMonitorCosmicHistograms::FillHistsTrue(), Init(), NtpMCModule::Reco(), and ~NtpMCRecord().

TClonesArray* NtpMCRecord::flsdigit
 

Definition at line 53 of file NtpMCRecord.h.

Referenced by Clear(), Init(), and ~NtpMCRecord().

TClonesArray* NtpMCRecord::mc
 

Definition at line 51 of file NtpMCRecord.h.

Referenced by NueSensitivity::Ana(), ANtpRecoNtpManipulator::ANtpRecoNtpManipulator(), Clear(), MadScanDisplay::DrawTextBox(), MadEvDisplay::DrawTextBox(), ReweightHelpers::EventRegistryFilla(), SntpHelpers::GetMCTruth(), MuParentHelper::GetMuParent(), Init(), MoqBase::LoadTruth(), MadBase::LoadTruth(), MoqBase::LoadTruthForReco(), MadBase::LoadTruthForReco(), Print(), NtpMCModule::Reco(), ANtpRecoNtpManipulator::SetRecord(), and ~NtpMCRecord().

NtpMCSummary NtpMCRecord::mchdr
 

Definition at line 48 of file NtpMCRecord.h.

Referenced by MCMonitorCosmicHistograms::FillHistsTrue(), MCMonitorBeamHistograms::FillHistsTrue(), MadBase::GetEntry(), Print(), and NtpMCModule::Reco().

NtpMCPhotonResult NtpMCRecord::photon
 

Definition at line 49 of file NtpMCRecord.h.

Referenced by NtpMCModule::Reco().

TClonesArray* NtpMCRecord::stdhep
 

Definition at line 52 of file NtpMCRecord.h.

Referenced by ANtpRecoNtpManipulator::ANtpRecoNtpManipulator(), Clear(), MadAnalysis::CreateANtpPAN(), MadScanDisplay::Display(), MadEvDisplay::Display(), MadScanDisplay::DrawInteractionDiagram(), MadEvDisplay::DrawInteractionDiagram(), ReweightHelpers::EventRegistryFilla(), MCMonitorCosmicHistograms::FillHistsReTr(), MCMonitorBeamHistograms::FillHistsTrue(), GnumiInterface::GetParent(), SntpHelpers::GetStdHepArray(), MadQuantities::HadronicFinalState(), Init(), MadQuantities::Initial_state(), MoqBase::LoadStdHep(), MadBase::LoadStdHep(), MadCluAnalysis::Plot(), NueDisplayModule::plotmc(), Print(), NtpMCModule::Reco(), ANtpRecoNtpManipulator::SetRecord(), MadQuantities::SetStdHepVars(), and ~NtpMCRecord().


The documentation for this class was generated from the following files:
Generated on Mon Jun 16 15:02:24 2008 for loon by  doxygen 1.3.9.1