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

NuMadAnalysis.cxx

Go to the documentation of this file.
00001 
00002 
00003 // Coded by ... Dec/2005       
00004 //                                                                    
00005 // Contact: 
00007 
00008 #include "TClonesArray.h"
00009 
00010 #include "MessageService/MsgService.h"
00011 #include "Mad/MadQuantities.h"
00012 
00013 #include "NuMuBar/NuMadAnalysis.h"
00014 
00015 using std::endl;
00016 using std::cout;
00017 using std::map;
00018 using std::vector;
00019 
00020 CVSID("$Id: NuMadAnalysis.cxx,v 1.1 2007/08/20 21:45:40 hartnell Exp $");
00021 
00022 //......................................................................
00023 
00024 NuMadAnalysis::NuMadAnalysis() : MadQuantities()
00025 {
00026   MSG("NuMadAnalysis",Msg::kInfo)
00027     <<"Running NuMadAnalysis Constructor..."<<endl;
00028   
00029   //I don't want to give it a chain...
00030   Bool_t chainSR=false;
00031 
00032   //mad base does this:
00033 
00034   fCurRun = -1;
00035   lastEntry = -1;
00036   if(!chainSR) {
00037     record = 0;
00038     emrecord = 0;
00039     mcrecord = 0;
00040     threcord = 0;
00041     strecord = 0;
00042     Clear();
00043     whichSource = -1;
00044     isMC = true;
00045     isTH = true;
00046     isEM = true;
00047     isST = false;
00048     Nentries = -1;
00049     fCurRun = -1;
00050     return;
00051   }
00052 
00053 }
00054 
00055 //......................................................................
00056 
00057 NuMadAnalysis::~NuMadAnalysis()
00058 {
00059   MSG("NuMadAnalysis",Msg::kDebug)
00060     <<"Running NuMadAnalysis Destructor..."<<endl;
00061   
00062 
00063   MSG("NuMadAnalysis",Msg::kDebug)
00064     <<"Finished NuMadAnalysis Destructor"<<endl;
00065 }
00066 
00067 //......................................................................
00068 
00069 void NuMadAnalysis::SetEntry(const NtpStRecord *ntp)
00070 {
00071   MSG("NuMadAnalysis",Msg::kVerbose)
00072     <<"SetEntry..."<<endl;
00073 
00078 
00079   //have to mess about const_casting everything because the 
00080   //base class members aren't const for some reason
00081 
00082   //set the data member
00083   strecord=const_cast<NtpStRecord*>(ntp);
00084   isST=true;
00085 
00086   //strecord=const_cast<NtpStRecord*>(strecord);
00087 
00088   //set other things:
00089   if(isST){
00090     ntpHeader=&(strecord->GetHeader());
00091     mcHeader=const_cast<NtpMCSummary*>(&(strecord->mchdr));
00092     shieldSummary=const_cast<NtpSRShieldSummary*>(&(strecord->vetohdr));
00093     eventSummary=const_cast<NtpSREventSummary*>( &(strecord->evthdr));
00094     dmxStatus=const_cast<NtpSRDmxStatus*>(&(strecord->dmxstatus));
00095     detStatus=const_cast<NtpSRDetStatus*>(&(strecord->detstatus));
00096     if(mcHeader->nmc==0) {
00097       isMC = false; isTH = false;
00098     }
00099     else {
00100       isMC = true;
00101       TClonesArray &array = *(strecord->thstp);
00102       if(array.GetEntries()>0) isTH = true;      
00103     }
00104   }
00105   fCurRun = ntpHeader->GetRun();
00106 
00107   LoadSlice(0);  
00108   LoadEvent(0);
00109   LoadTrack(0);
00110   LoadCluster(0);
00111   LoadShower(0);
00112   LoadShieldStrip(0);
00113   
00114   MSG("NuMadAnalysis",Msg::kVerbose)
00115     <<"SetEntry... done!"<<endl;
00116 }
00117 
00118 //......................................................................

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