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
 summary data for mc record
NtpMCPhotonResult photon
 summary data from photon transport mc
NtpMCDetSimResult detsim
 summary data from det sim mc
TClonesArray * mc
TClonesArray * stdhep
TClonesArray * flsdigit
TClonesArray * digihit

Private Member Functions

void Init ()

Detailed Description

Definition at line 25 of file NtpMCRecord.h.


Constructor & Destructor Documentation

NtpMCRecord::NtpMCRecord (  ) 

Definition at line 25 of file NtpMCRecord.cxx.

References Msg::kVerbose, and 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(), Msg::kVerbose, 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(), Msg::kVerbose, 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 ( void   )  [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(), 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

summary data from det sim mc

Definition at line 50 of file NtpMCRecord.h.

Referenced by Clear().

TClonesArray* NtpMCRecord::digihit

Definition at line 54 of file NtpMCRecord.h.

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

TClonesArray* NtpMCRecord::flsdigit

Definition at line 53 of file NtpMCRecord.h.

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

TClonesArray* NtpMCRecord::mc

summary data for mc record

Definition at line 48 of file NtpMCRecord.h.

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

summary data from photon transport mc

Definition at line 49 of file NtpMCRecord.h.

TClonesArray* NtpMCRecord::stdhep

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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1