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

NtpAlignmentRecord.cxx

Go to the documentation of this file.
00001 /***************************************************************************
00002                           NtpAlignmentRecord.cxx  -  description
00003                              -------------------
00004 
00005  ***************************************************************************/
00006 
00007 //My code
00008 #include "NtpAlignmentRecord.h"
00009 
00010 //MINOS
00011 #include "Record/RecArrayAllocator.h"
00012 
00013 //General C++
00014 #include <iostream>
00015 
00016 using std::endl;
00017 
00018 ClassImp(NtpAlignmentRecord)
00019 
00020 NtpAlignmentRecord::NtpAlignmentRecord()  
00021    :RecRecordImp<RecCandHeader>(),
00022     nstrip(0),
00023     ntrackvstrip(0),
00024     ntrackustrip(0),
00025     ncandvstrip(0),
00026     ncandustrip(0),
00027     trackvstrip(0),
00028     trackustrip(0),
00029     candvstrip(0),
00030     candustrip(0)
00031 {
00032    this -> Init();
00033 }
00034 
00035 
00036 NtpAlignmentRecord::NtpAlignmentRecord(const RecCandHeader& hdr) 
00037    :RecRecordImp<RecCandHeader>(hdr),
00038     nstrip(0),
00039     ntrackvstrip(0),
00040     ntrackustrip(0),
00041     ncandvstrip(0),
00042     ncandustrip(0),
00043     trackvstrip(0),
00044     trackustrip(0),
00045     candvstrip(0),
00046     candustrip(0)
00047 {   
00048 
00049    this -> Init();
00050 }
00051 
00052 
00053 NtpAlignmentRecord::~NtpAlignmentRecord() {
00054    // Purpose: Destructor
00055    // Release arrays back to TClonesArray pool for reuse
00056    // Allocated memory of stored objects is retrieved via object Clear call
00057 
00058    RecArrayAllocator& allocator = RecArrayAllocator::Instance();
00059 
00060    if (trackvstrip) { 
00061       allocator.ReleaseArray(trackvstrip); 
00062       trackvstrip = 0; 
00063    }
00064    
00065    if (trackustrip) { 
00066       allocator.ReleaseArray(trackustrip); 
00067       trackustrip = 0; 
00068    }
00069    
00070    if (candvstrip) { 
00071       allocator.ReleaseArray(candvstrip); 
00072       candvstrip = 0; 
00073    }
00074    
00075    if (candustrip) { 
00076       allocator.ReleaseArray(candustrip); 
00077       candustrip = 0; 
00078    }
00079 }
00080 
00081 void NtpAlignmentRecord::Init() 
00082 {
00083    SetClearable(true);
00084    
00085    vcharge = 0.0;
00086    ucharge = 0.0;
00087    vcandcharge = 0.0;
00088    ucandcharge = 0.0;
00089    vtrackrms = 0.0;
00090    utrackrms = 0.0;
00091    vfita = 0.0;
00092    ufita = 0.0;
00093    vfitb = 0.0;
00094    ufitb = 0.0;
00095    vsigmaofa = 0.0;
00096    usigmaofa = 0.0;
00097    vsigmaofb = 0.0;
00098    usigmaofb = 0.0;
00099    vsigmaoftpos = 0.0;
00100    usigmaoftpos = 0.0;
00101    vcovab = 0.0;
00102    ucovab = 0.0;   
00103    hcosu = 0.0;
00104    hcosv = 0.0;
00105    hcosz = 0.0;
00106    udt = 0.0;
00107    vdt = 0.0;
00108    dt  = 0.0;
00109 
00110    // Purpose: Initialize ntuple TClonesArrays
00111    
00112    RecArrayAllocator& allocator = RecArrayAllocator::Instance();
00113    
00114    if(!trackvstrip) 
00115       trackvstrip = allocator.GetArray("NtpAlignTrackStrip");
00116 
00117    if(!trackustrip) 
00118       trackustrip = allocator.GetArray("NtpAlignTrackStrip");
00119 
00120    if(!candvstrip) 
00121       candvstrip = allocator.GetArray("NtpAlignCandStrip");
00122    
00123    if(!candustrip) 
00124       candustrip = allocator.GetArray("NtpAlignCandStrip");
00125 }
00126 
00127 void NtpAlignmentRecord::Clear(Option_t* /* option */)
00128 {
00129    vcharge = 0.0;
00130    ucharge = 0.0;
00131    vcandcharge = 0.0;
00132    ucandcharge = 0.0;
00133    vtrackrms = 0.0;
00134    utrackrms = 0.0;
00135    vfita = 0.0;
00136    ufita = 0.0;
00137    vfitb = 0.0;
00138    ufitb = 0.0;
00139    vsigmaofa = 0.0;
00140    usigmaofa = 0.0;
00141    vsigmaofb = 0.0;
00142    usigmaofb = 0.0;
00143    vsigmaoftpos = 0.0;
00144    usigmaoftpos = 0.0;
00145    vcovab = 0.0;
00146    ucovab = 0.0;   
00147    hcosu = 0.0;
00148    hcosv = 0.0;
00149    hcosz = 0.0;
00150    udt = 0.0;
00151    vdt = 0.0;
00152    dt  = 0.0;
00153 
00154    if(trackvstrip) 
00155       trackvstrip -> Clear("C");   
00156    if(trackustrip) 
00157       trackustrip -> Clear("C");
00158    if(candvstrip) 
00159       candvstrip -> Clear("C");   
00160    if(candustrip) 
00161       candustrip -> Clear("C");
00162 }
00163 
00164 std::ostream& NtpAlignmentRecord::Print(std::ostream& os) const {
00165   //
00166   // Purpose: Print status of ntuple record on ostream
00167   //
00168    
00169    os << "NtpAlignmentRecord::Print" << endl;
00170    RecRecordImp<RecCandHeader>::Print(os);
00171    
00172    return os;
00173    
00174 }
00175 
00176 void NtpAlignmentRecord::Print(const Option_t* /* option */) const {
00177    //
00178    // Purpose: Print record in form supported by TObject::Print
00179    //
00180    
00181    Print(std::cout);
00182    return;
00183    
00184 }

Generated on Mon Feb 15 11:07:05 2010 for loon by  doxygen 1.3.9.1