TME_SiArmTDiff Class Reference
[Modules]

Testing the TMEs for my Al50 analysis. More...

#include <TME_SiArmTDiff.h>

Inheritance diagram for TME_SiArmTDiff:
BaseModule

List of all members.

Public Member Functions

 TME_SiArmTDiff (modules::options *opts)
 Constructor description. If necessary, add a details tag like above.
 ~TME_SiArmTDiff ()
 Is anything done in the destructor?
int ProcessGenericEntry (TGlobalData *gData, const TSetupData *gSetup)
int Preprocess (TGlobalData *gData, const TSetupData *gSetup)
 Method called by the main pre-process loop.
int Postprocess (TGlobalData *gData, const TSetupData *gSetup)
 Method called by the main pre-process loop.
void SetAlias (const std::string &alias)
std::string GetAlias () const
const char * GetName () const
 Get the name of this module as given to the constructor of the base class.

Protected Member Functions

bool Debug () const
TDirectory * GetDirectory () const
 Get the TDirectory for this module.
TDirectory * GetDirectory (const std::string &name="")

Protected Attributes

TDirectory * dir

Private Types

typedef std::vector< IDs::channelDetectorList

Private Member Functions

virtual int ProcessEntry (TGlobalData *gData, const TSetupData *gSetup)
 What's calculated for every entry? Don't hesitate to repeat what was said in the class description.
virtual int BeforeFirstEntry (TGlobalData *gData, const TSetupData *setup)
 What needes to be done before each run? Don't hesitate to repeat what was said in the class description.
virtual int AfterLastEntry (TGlobalData *gData, const TSetupData *setup)
 What needs to be done after each run? Don't hesitate to repeat what was said in the class description.

Private Attributes

long int fNullCount
long int fTdpCount
bool fQuit
DetectorList fSiL1
IDs::channelfSiL2
DetectorList fSiR1
IDs::channelfSiR2
TH1F * fSiLTDiffs
TH1F * fSiRTDiffs

Detailed Description

Testing the TMEs for my Al50 analysis.

Author:
Andrew Edmonds

A longer, more descriptive block of text. Specifics like members and methods will be described later. You can add this to other groups instead of rootana_modules or in addition to rootana_modules by adding more of the ingroup tags.

Definition at line 28 of file TME_SiArmTDiff.h.


Member Typedef Documentation

typedef std::vector<IDs::channel> TME_SiArmTDiff::DetectorList [private]

Definition at line 64 of file TME_SiArmTDiff.h.


Constructor & Destructor Documentation

TME_SiArmTDiff::TME_SiArmTDiff ( modules::options opts  ) 

Constructor description. If necessary, add a details tag like above.

Parameters:
[in] opts Describe the options this module takes.

Definition at line 21 of file TME_SiArmTDiff.cpp.

00021                                                   :
00022    BaseModule("TME_SiArmTDiff",opts),fNullCount(0),fTdpCount(0){
00023 }

TME_SiArmTDiff::~TME_SiArmTDiff (  ) 

Is anything done in the destructor?

Definition at line 25 of file TME_SiArmTDiff.cpp.

00025                                {
00026 }


Member Function Documentation

int TME_SiArmTDiff::AfterLastEntry ( TGlobalData gData,
const TSetupData setup 
) [private, virtual]

What needs to be done after each run? Don't hesitate to repeat what was said in the class description.

Returns:
Non-zero to indicate a problem.

Implements BaseModule.

Definition at line 128 of file TME_SiArmTDiff.cpp.

00128                                                                             {
00129 
00130   return 0;
00131 }

int TME_SiArmTDiff::BeforeFirstEntry ( TGlobalData gData,
const TSetupData setup 
) [private, virtual]

What needes to be done before each run? Don't hesitate to repeat what was said in the class description.

Returns:
Non-zero to indicate a problem.

Implements BaseModule.

Definition at line 28 of file TME_SiArmTDiff.cpp.

References fSiL1, fSiL2, fSiLTDiffs, fSiR1, fSiR2, fSiRTDiffs, IDs::kNotApplicable, IDs::kSiL1_1, IDs::kSiL1_2, IDs::kSiL1_3, IDs::kSiL1_4, IDs::kSiL2, IDs::kSiR1_1, IDs::kSiR1_2, IDs::kSiR1_3, IDs::kSiR1_4, and IDs::kSiR2.

00028                                                                               {
00029     using namespace IDs;
00030     fSiL1.push_back(IDs::channel (kSiL1_1 , kNotApplicable ));
00031     fSiL1.push_back(IDs::channel (kSiL1_2 , kNotApplicable ));
00032     fSiL1.push_back(IDs::channel (kSiL1_3 , kNotApplicable ));
00033     fSiL1.push_back(IDs::channel (kSiL1_4 , kNotApplicable ));
00034     fSiL2 = new IDs::channel (kSiL2   , kNotApplicable );
00035     fSiR1.push_back(IDs::channel (kSiR1_1 , kNotApplicable ));
00036     fSiR1.push_back(IDs::channel (kSiR1_2 , kNotApplicable ));
00037     fSiR1.push_back(IDs::channel (kSiR1_3 , kNotApplicable ));
00038     fSiR1.push_back(IDs::channel (kSiR1_4 , kNotApplicable ));
00039     fSiR2 = new IDs::channel (kSiR2   , kNotApplicable );
00040     //    fSiL1.push_back(IDs::channel (kMuSc   , kNotApplicable ));
00041     fSiLTDiffs = new TH1F("hSiLTDiffs", "TDiffs Between thick and thin SiL", 5000, -5e3,5e3);
00042     fSiLTDiffs->SetXTitle("t_thick - t_thin (ns)");
00043 
00044     fSiRTDiffs = new TH1F("hSiRTDiffs", "TDiffs Between thick and thin SiR", 5000, -5e3,5e3);
00045     fSiRTDiffs->SetXTitle("t_thick - t_thin (ns)");
00046 
00047   return 0;
00048 }

bool BaseModule::Debug (  )  const [inline, protected, inherited]
std::string BaseModule::GetAlias (  )  const [inline, inherited]

Returns a string for the alias of this module. May be empty if no alias was given in the modules file.

Definition at line 63 of file BaseModule.h.

References BaseModule::fAlias.

Referenced by BaseModule::BaseModule().

00063 {return fAlias;};

TDirectory * BaseModule::GetDirectory ( const std::string &  name = ""  )  [protected, inherited]

Definition at line 77 of file BaseModule.cpp.

References BaseModule::dir, and BaseModule::fDirectory.

00077                                                          {
00078   if(name.empty()) return fDirectory;
00079   TDirectory* dir=fDirectory->GetDirectory(name.c_str());
00080   if(dir) return dir;
00081   return fDirectory->mkdir(name.c_str());
00082 }

TDirectory* BaseModule::GetDirectory (  )  const [inline, protected, inherited]
const char* BaseModule::GetName (  )  const [inline, inherited]

Get the name of this module as given to the constructor of the base class.

Definition at line 66 of file BaseModule.h.

References BaseModule::fName.

Referenced by SavePulses::BeforeFirstEntry(), PlotTDPs::BeforeFirstEntry(), PlotTDP_TDiff::BeforeFirstEntry(), PlotTAP_Time::ProcessEntry(), PlotTAP_Energy::ProcessEntry(), PlotTAP_Amplitude::ProcessEntry(), and LoopSequence::Run().

00066 {return fName.c_str();};

int BaseModule::Postprocess ( TGlobalData gData,
const TSetupData gSetup 
) [inherited]

Method called by the main pre-process loop.

Does some simple work, then hooks into the derived class through AfterLastEntry.

Returns:
0 on sucess and non-zero if a problem occurred

Definition at line 66 of file BaseModule.cpp.

References BaseModule::AfterLastEntry(), and BaseModule::fDirectory.

Referenced by LoopSequence::Postprocess().

00066                                                                        {
00067   // This is called by our main routine and would allow later to split into different 
00068   // process routines if we have more than one Tree and hence different tpyes of data input.
00069 
00070   if(fDirectory) fDirectory->cd();
00071   int ret = AfterLastEntry(gData, gSetup);
00072   gDirectory->cd("/");
00073 
00074   return ret;
00075 }

int BaseModule::Preprocess ( TGlobalData gData,
const TSetupData gSetup 
) [inherited]

Method called by the main pre-process loop.

Does some simple work, then hooks into the derived class through BeforeFirstEntry.

Returns:
0 on sucess and non-zero if a problem occurred

Definition at line 55 of file BaseModule.cpp.

References BaseModule::BeforeFirstEntry(), and BaseModule::fDirectory.

Referenced by LoopSequence::Preprocess().

00055                                                                       {
00056   // This is called by our main routine and would allow later to split into different 
00057   // process routines if we have more than one Tree and hence different tpyes of data input.
00058 
00059   if(fDirectory) fDirectory->cd();
00060   int ret = BeforeFirstEntry(gData, gSetup);
00061   gDirectory->cd("/");
00062 
00063   return ret;
00064 }

int TME_SiArmTDiff::ProcessEntry ( TGlobalData gData,
const TSetupData gSetup 
) [private, virtual]

What's calculated for every entry? Don't hesitate to repeat what was said in the class description.

Returns:
Non-zero to indicate a problem.

Implements BaseModule.

Definition at line 50 of file TME_SiArmTDiff.cpp.

References fSiL1, fSiL2, fSiLTDiffs, fSiR1, fSiR2, fSiRTDiffs, TDetectorPulse::GetTime(), and gMuonEvents.

00050                                                                           {
00051 
00052     for(MuonEventList::const_iterator i_tme=gMuonEvents.begin();
00053             i_tme!=gMuonEvents.end(); ++i_tme){
00054 
00055       // First, check for pile-up in the muSc
00056       if ( (*i_tme)->HasMuonPileup()) {
00057         continue;
00058       }
00059 
00060       double tme_time= (*i_tme)->GetTime(); // this is the same as the muSc time
00061 
00062       // Now loop through the SiL1
00063       for(DetectorList::const_iterator i_det=fSiL1.begin();
00064                 i_det!=fSiL1.end(); ++i_det){
00065         // pulses per channel
00066         int SiL1_source_index=(*i_tme)->GetSourceIndex(*i_det);
00067         while(SiL1_source_index>-1){
00068           const IDs::source& SiL1_source=(*i_tme)->GetSource(SiL1_source_index);
00069           
00070           int n_SiL1 = (*i_tme)->NumPulses(SiL1_source);
00071           //          std::cout << SiL1_source << " has " << n_SiL1 << " pulses" << std::endl;
00072           for(int i=0; i<n_SiL1; ++i){
00073             const TDetectorPulse* tdp=(*i_tme)->GetPulse(SiL1_source,i);
00074             double thin_time = tdp->GetTime();
00075 
00076             // Loop trhough the SiL2 pulses
00077             int SiL2_source_index=(*i_tme)->GetSourceIndex(*fSiL2);
00078             while (SiL2_source_index>-1) {
00079               const IDs::source& SiL2_source=(*i_tme)->GetSource(SiL2_source_index);
00080               int n_SiL2 = (*i_tme)->NumPulses(SiL2_source);
00081               for (int j=0; j<n_SiL2; ++j) {
00082                 const TDetectorPulse* tdp_SiL2=(*i_tme)->GetPulse(SiL2_source,j);
00083                 double thick_time = tdp_SiL2->GetTime();
00084                 fSiLTDiffs->Fill(thick_time - thin_time);
00085               }
00086               SiL2_source_index=(*i_tme)->GetSourceIndex(*fSiL2,SiL2_source_index+1);
00087             }
00088           }
00089           SiL1_source_index=(*i_tme)->GetSourceIndex(*i_det,SiL1_source_index+1);
00090         }
00091       }
00092 
00093       // Now loop through the SiR1
00094       for(DetectorList::const_iterator i_det=fSiR1.begin();
00095                 i_det!=fSiR1.end(); ++i_det){
00096         // pulses per channel
00097         int SiR1_source_index=(*i_tme)->GetSourceIndex(*i_det);
00098         while(SiR1_source_index>-1){
00099           const IDs::source& SiR1_source=(*i_tme)->GetSource(SiR1_source_index);
00100           
00101           int n_SiR1 = (*i_tme)->NumPulses(SiR1_source);
00102           //          std::cout << SiR1_source << " has " << n_SiR1 << " pulses" << std::endl;
00103           for(int i=0; i<n_SiR1; ++i){
00104             const TDetectorPulse* tdp=(*i_tme)->GetPulse(SiR1_source,i);
00105             double thin_time = tdp->GetTime();
00106 
00107             // Loop trhough the SiR2 pulses
00108             int SiR2_source_index=(*i_tme)->GetSourceIndex(*fSiR2);
00109             while (SiR2_source_index>-1) {
00110               const IDs::source& SiR2_source=(*i_tme)->GetSource(SiR2_source_index);
00111               int n_SiR2 = (*i_tme)->NumPulses(SiR2_source);
00112               for (int j=0; j<n_SiR2; ++j) {
00113                 const TDetectorPulse* tdp_SiR2=(*i_tme)->GetPulse(SiR2_source,j);
00114                 double thick_time = tdp_SiR2->GetTime();
00115                 fSiRTDiffs->Fill(thick_time - thin_time);
00116               }
00117               SiR2_source_index=(*i_tme)->GetSourceIndex(*fSiR2,SiR2_source_index+1);
00118             }
00119           }
00120           SiR1_source_index=(*i_tme)->GetSourceIndex(*i_det,SiR1_source_index+1);
00121         }
00122       }
00123     }
00124 
00125   return 0;
00126 }

int BaseModule::ProcessGenericEntry ( TGlobalData gData,
const TSetupData gSetup 
) [inherited]

Method called by the main event loop for each entry in the input root tree. Does some simple work, then hooks into the derived class through ProcessEntry.

Returns:
0 on sucess and non-zero if a problem occurred

Definition at line 44 of file BaseModule.cpp.

References BaseModule::fDirectory, and BaseModule::ProcessEntry().

Referenced by LoopSequence::Process().

00044                                                                                {
00045   // This is called by our main routine and would allow later to split into different 
00046   // process routines if we have more than one Tree and hence different tpyes of data input.
00047 
00048   if(fDirectory) fDirectory->cd();
00049   int ret = ProcessEntry(gData, gSetup);
00050   gDirectory->cd("/");
00051 
00052   return ret;
00053 }

void BaseModule::SetAlias ( const std::string &  alias  )  [inline, inherited]

Sets the alias for this module, which should be provided in the modules file

Definition at line 59 of file BaseModule.h.

References BaseModule::fAlias.

Referenced by BaseModule::BaseModule().

00059 {fAlias=alias;};


Member Data Documentation

TDirectory* BaseModule::dir [protected, inherited]

Many modules use 'dir' still which was the old protected pointer to the modules directory. To prevent things being broken so soon, we keep this pointer available, but be warned that it will be removed shortly...

Definition at line 98 of file BaseModule.h.

Referenced by BaseModule::BaseModule(), FastSlowCompare::FastSlowCompare(), GeSpectrum::GeSpectrum(), BaseModule::GetDirectory(), MakeMuonEvents::MakeMuonEvents(), and PlotAmpVsTDiff::PlotAmpVsTDiff().

long int TME_SiArmTDiff::fNullCount [private]

Definition at line 60 of file TME_SiArmTDiff.h.

bool TME_SiArmTDiff::fQuit [private]

Definition at line 62 of file TME_SiArmTDiff.h.

Definition at line 65 of file TME_SiArmTDiff.h.

Referenced by BeforeFirstEntry(), and ProcessEntry().

Definition at line 66 of file TME_SiArmTDiff.h.

Referenced by BeforeFirstEntry(), and ProcessEntry().

TH1F* TME_SiArmTDiff::fSiLTDiffs [private]

Definition at line 70 of file TME_SiArmTDiff.h.

Referenced by BeforeFirstEntry(), and ProcessEntry().

Definition at line 67 of file TME_SiArmTDiff.h.

Referenced by BeforeFirstEntry(), and ProcessEntry().

Definition at line 68 of file TME_SiArmTDiff.h.

Referenced by BeforeFirstEntry(), and ProcessEntry().

TH1F* TME_SiArmTDiff::fSiRTDiffs [private]

Definition at line 71 of file TME_SiArmTDiff.h.

Referenced by BeforeFirstEntry(), and ProcessEntry().

long int TME_SiArmTDiff::fTdpCount [private]

Definition at line 60 of file TME_SiArmTDiff.h.


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

Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1