CandDigitModule Class Reference

#include <CandDigitModule.h>

Inheritance diagram for CandDigitModule:
JobCModule

List of all members.

Public Member Functions

 CandDigitModule ()
virtual ~CandDigitModule ()
JobCResult Ana (const MomNavigator *mom)

Detailed Description

Definition at line 22 of file CandDigitModule.h.


Constructor & Destructor Documentation

CandDigitModule::CandDigitModule (  ) 

Definition at line 39 of file CandDigitModule.cxx.

00040 {
00041 }

CandDigitModule::~CandDigitModule (  )  [virtual]

Definition at line 44 of file CandDigitModule.cxx.

00045 {
00046 }


Member Function Documentation

JobCResult CandDigitModule::Ana ( const MomNavigator mom  )  [virtual]

Implement this for read only access to the MomNavigator

Reimplemented from JobCModule.

Definition at line 49 of file CandDigitModule.cxx.

References RawDigitDataBlock::At(), MuELoss::e, CandRecord::FindCandHandle(), CandDigitHandle::GetCharge(), RawDigit::GetCrateT0(), CandHandle::GetDaughterIterator(), CandHeader::GetEvent(), MomNavigator::GetFragment(), RecMinos::GetHeader(), VldTimeStamp::GetNanoSec(), CandTrackHandle::GetNTrackPlane(), CandStripHandle::GetPlane(), CandHeader::GetRun(), CandHeader::GetSnarl(), CandStripHandle::GetStrip(), CandDigitHandle::GetSubtractedTime(), JobCResult::kFailed, JobCResult::kPassed, CalTimeType::kT0, Msg::kWarning, and MSG.

00050 {
00051   static Int_t counter = 0;
00052 
00053   if (!mom){
00054     MSG("CandDigitModule",Msg::kWarning) 
00055       << "No Mom!" << endl;
00056     assert(0);
00057   }
00058 
00059   //Start by getting the crateT0
00060   Double_t crateT0 = -9999.9;
00061   const RawDigitDataBlock* rddb = DataUtil::GetRawBlock<RawDigitDataBlock>(mom);
00062   if (!rddb){
00063     MSG("CandDigitModule", Msg::kWarning)
00064       << "No RawDigitDataBlock" << endl;
00065     return JobCResult::kFailed;
00066   }
00067   const RawDigit* rawDigit = rddb->At(0);
00068   if (rawDigit){
00069     crateT0 = rawDigit->GetCrateT0().GetNanoSec();
00070   }
00071   else{
00072     MSG("CandDigitModule", Msg::kWarning)
00073       << "No raw digit found" << endl;
00074     return JobCResult::kFailed;
00075   }
00076   
00077   const CandRecord* candRec = dynamic_cast<CandRecord*>
00078     (mom->GetFragment("CandRecord"));
00079   
00080   if (!candRec){
00081     MSG("CandDigitModule",Msg::kWarning) 
00082       << "No CandRecord in Mom" << endl;
00083     return JobCResult::kFailed;
00084   }
00085 
00086   //Get the run information
00087   const CandHeader* candHeader = dynamic_cast<const CandHeader*>(candRec->GetHeader());
00088   if (!candHeader){
00089     MSG("CandDigitModule", Msg::kWarning)
00090       << "No CandHeader found in CandRecord" << endl;
00091     return JobCResult::kFailed;
00092   }
00093 
00094   cout << "Run: " << candHeader->GetRun()
00095        << ", snarl: " << candHeader->GetSnarl()
00096        << ", event: " << candHeader->GetEvent()
00097        << endl;
00098   
00099   ofstream fout("/minos/data/users/evansj/ToFU/DigitList.txt", ios::app);
00100   fout.precision(20);
00101   
00102   CandTrackCamListHandle* trackListHandle = dynamic_cast<CandTrackCamListHandle*>
00103     (candRec->FindCandHandle("CandTrackCamListHandle"));
00104   if (!trackListHandle){
00105     MSG("CandDigitModule", Msg::kWarning)
00106       << "No CandTrackCamListHandle" << endl;
00107     return JobCResult::kFailed;
00108   }
00109   
00110   if (!(counter%100)){cout << "This is snarl " << counter << endl;}
00111   cout.precision(20);
00112   
00113   //Iterate over the tracks
00114   TIter trackHandleListIt = trackListHandle->GetDaughterIterator();
00115   CandTrackCamHandle* trackHandle = 0;
00116   static Int_t trackCounter = 0;
00117   while ((trackHandle = dynamic_cast<CandTrackCamHandle*>
00118          (trackHandleListIt.Next()))){
00119 
00120     if (trackHandle->GetNTrackPlane() < 50){continue;}
00121     
00122     //Iterate over the strips
00123     TIter stripIter = trackHandle->GetDaughterIterator();
00124     CandStripHandle* stripHandle = 0;
00125     Int_t stripCounter = 0;
00126     while ((stripHandle = dynamic_cast<CandStripHandle*>
00127            (stripIter.Next()))){
00128 
00129       Int_t planeNo = stripHandle->GetPlane();
00130       Int_t stripNo = stripHandle->GetStrip();
00131       
00132       //Now iterate over the digits
00133       TIter digitIter = stripHandle->GetDaughterIterator();
00134       CandDigitHandle* digitHandle = 0;
00135       Int_t digitCounter = 0;
00136       while ((digitHandle = dynamic_cast<CandDigitHandle*>
00137              (digitIter.Next()))){
00138         
00139         Double_t digitCharge = digitHandle->GetCharge();
00140         //The following three times all seem to be the same
00141         //      Double_t digitTime = digitHandle->GetTime(CalTimeType::kT0);
00142         Double_t absDigitTime = digitHandle->GetSubtractedTime(CalTimeType::kT0);
00143         //      Double_t uncalAbsDigitTime = digitHandle->GetSubtractedTime(CalTimeType::kNone);
00144 
00145         Double_t crateModTime = absDigitTime + crateT0*1e-9;
00146         Double_t batchLength = 1.61938e-6;//86*18.83 ns
00147         Double_t tempIntPart = 0;
00148         Double_t loopedTime = modf(crateModTime / batchLength, &tempIntPart);
00149 
00150 //      cout << "crateTo: " << crateT0 << " absDigitTime: " << absDigitTime
00151 //           << ", loopedTime: " << loopedTime << endl;
00152         
00153         fout << trackCounter << "\t" << stripCounter << "\t" << digitCounter << "\t" << absDigitTime << "\t" << digitCharge << "\t" << crateT0 << "\t" << loopedTime << "\t" << planeNo << "\t" << stripNo << endl;
00154         ++digitCounter;
00155       }
00156       ++stripCounter;
00157       
00158     }
00159     ++trackCounter;
00160   }
00161  
00162 //   if (counter > 1000){
00163 //     assert(false);
00164 //   }
00165   ++counter;
00166   
00167   return JobCResult::kPassed;
00168 }


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

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1