Single event in the muon centred tree. More...
#include <TMuonEvent.h>
Public Types | |
enum | LeftRight_t { kLeft, kRight } |
Public Member Functions | |
TMuonEvent (const TDetectorPulse *central_mu, double window) | |
Construct a TMuonEvent with a known central muon. | |
TMuonEvent () | |
Default constructor for a TMuonEvent. | |
~TMuonEvent () | |
Destructor. | |
void | Reset () |
Reset a TME's list of pulses. | |
void | AddPulse (const IDs::source &source, TDetectorPulse *pulse) |
Add a pulse into the list of pulses. | |
void | AddPulses (const IDs::source &source, DetectorPulseList::const_iterator start, DetectorPulseList::const_iterator stop) |
const IDs::source & | GetSource (int n) const |
Get the n-th source that contains pulses. | |
int | GetNumSources () const |
Get the number of sources with pulses in this TME. | |
int | GetSourceIndex (const IDs::channel &ch, int start=0) const |
Get the index of the next source to match channel, ch, starting at index start. | |
int | GetFirstSourceIndex (const IDs::channel &ch) const |
int | GetLastSourceIndex (const IDs::channel &ch) const |
const TDetectorPulse * | GetPulse (const IDs::source &detector, int index) const |
Retrieve a pulse from the specified source and position in the pulse list. | |
DetectorPulseList::const_iterator | BeginPulses (const IDs::source &detector) const |
Get a const_iterator to the beginning of the pulse list for a given source. | |
DetectorPulseList::const_iterator | EndPulses (const IDs::source &detector) const |
Get a const_iterator to the end of the pulse list for a given source. | |
int | TotalNumPulses () const |
Get the total number of pulses contained in this TME. | |
int | NumPulses (const IDs::channel &channel) const |
Get the number of pulses contained in this TME for a given channel. | |
int | NumPulses (const IDs::source &source) const |
Get the number of pulses contained in this TME for a given source. | |
bool | HasMuonHit () const |
Does this TME pass the muon hit criteria. | |
bool | HasMuonPileup () const |
Does this TME pass the muon pile-up criteria. | |
bool | WasEarlyInEvent () const |
Get whether or not this TME is flagged as early in an event. | |
bool | WasLateInEvent (double event_length, double event_uncertainty) const |
Get whether or not this TME is flagged as late in an event. | |
void | AllPulsesUsed (const IDs::source &so) |
Set whether all pulses for a certain channel were used up. | |
bool | WereNoPulsesLeft () const |
Get whether all pulses for ANY channel were used up. | |
bool | WereNoPulsesLeft (const IDs::source &so) const |
Get whether all pulses for a specific channel were used up. | |
double | GetTime () const |
Get the time of this TME defined as the arrival time of the central muon. | |
double | GetAmplitude () const |
const TDetectorPulse * | GetCentralMuon () const |
void | InsertSiliconEvent (LeftRight_t lr, const TSiliconEvent &si_evt) |
SiliconHitList::const_iterator | BeginSiEvents (LeftRight_t lr) const |
SiliconHitList::const_iterator | EndSiEvents (LeftRight_t lr) const |
int | NumSiHits (LeftRight_t lr) const |
Private Types | |
typedef std::set< IDs::source > | SourceSet |
Private Member Functions | |
ClassDef (TMuonEvent, 1) | |
Private Attributes | |
SourceDetPulseMap | fPulseLists |
SiliconHitList | fSiliconHits [2] |
const TDetectorPulse * | fCentralMuon |
double | fWindowWidth |
SourceSet | fExhaustedChannels |
Single event in the muon centred tree.
Implement muon pile-up and hit flags Implement early / late TME flags
Definition at line 23 of file TMuonEvent.h.
typedef std::set<IDs::source> TMuonEvent::SourceSet [private] |
Definition at line 121 of file TMuonEvent.h.
TMuonEvent::TMuonEvent | ( | const TDetectorPulse * | central_mu, | |
double | window | |||
) | [inline] |
Construct a TMuonEvent with a known central muon.
Definition at line 28 of file TMuonEvent.h.
00028 : 00029 fCentralMuon(central_mu),fWindowWidth(window) {};
TMuonEvent::TMuonEvent | ( | ) | [inline] |
Default constructor for a TMuonEvent.
Definition at line 31 of file TMuonEvent.h.
00031 : 00032 fCentralMuon(NULL),fWindowWidth(0){};
TMuonEvent::~TMuonEvent | ( | ) | [inline] |
Destructor.
empty since TMuonEvent doesn't own the pulses it contains
Definition at line 36 of file TMuonEvent.h.
void TMuonEvent::AddPulse | ( | const IDs::source & | source, | |
TDetectorPulse * | pulse | |||
) |
Add a pulse into the list of pulses.
Definition at line 27 of file TMuonEvent.cpp.
References fPulseLists.
Referenced by MaxTimeDiffMEGenerator::ProcessPulses().
00027 { 00028 fPulseLists[source].push_back(pulse); 00029 }
void TMuonEvent::AddPulses | ( | const IDs::source & | source, | |
DetectorPulseList::const_iterator | start, | |||
DetectorPulseList::const_iterator | stop | |||
) |
Definition at line 31 of file TMuonEvent.cpp.
References fPulseLists.
Referenced by FixedWindowMEGenerator::AddPulsesInWindow().
00033 { 00034 if(stop-start <0) throw Except::EndOfWindowBeforeStart(); 00035 for(DetectorPulseList::const_iterator i_p=start; i_p!=stop; ++i_p){ 00036 if( (*i_p)->IsGood()) fPulseLists[source].push_back(*i_p); 00037 } 00038 }
void TMuonEvent::AllPulsesUsed | ( | const IDs::source & | so | ) | [inline] |
Set whether all pulses for a certain channel were used up.
Definition at line 97 of file TMuonEvent.h.
References fExhaustedChannels.
Referenced by FixedWindowMEGenerator::AddPulsesInWindow().
00097 {fExhaustedChannels.insert(so);};
DetectorPulseList::const_iterator TMuonEvent::BeginPulses | ( | const IDs::source & | detector | ) | const |
Get a const_iterator to the beginning of the pulse list for a given source.
Definition at line 120 of file TMuonEvent.cpp.
References fPulseLists, and NumPulses().
Referenced by MakeSiliconEvents::ProcessEntry().
00120 { 00121 if(NumPulses(detector)==0) return DetectorPulseList::const_iterator(); 00122 return fPulseLists.at(detector).begin(); 00123 }
SiliconHitList::const_iterator TMuonEvent::BeginSiEvents | ( | LeftRight_t | lr | ) | const [inline] |
Definition at line 112 of file TMuonEvent.h.
References fSiliconHits.
00112 { return fSiliconHits[lr].begin();}
TMuonEvent::ClassDef | ( | TMuonEvent | , | |
1 | ||||
) | [private] |
DetectorPulseList::const_iterator TMuonEvent::EndPulses | ( | const IDs::source & | detector | ) | const |
Get a const_iterator to the end of the pulse list for a given source.
Definition at line 124 of file TMuonEvent.cpp.
References fPulseLists, and NumPulses().
Referenced by MakeSiliconEvents::ProcessEntry().
00124 { 00125 if(NumPulses(detector)==0) return DetectorPulseList::const_iterator(); 00126 return fPulseLists.at(detector).end(); 00127 }
SiliconHitList::const_iterator TMuonEvent::EndSiEvents | ( | LeftRight_t | lr | ) | const [inline] |
Definition at line 113 of file TMuonEvent.h.
References fSiliconHits.
00113 { return fSiliconHits[lr].end();}
double TMuonEvent::GetAmplitude | ( | ) | const [inline] |
Definition at line 106 of file TMuonEvent.h.
References fCentralMuon, TDetectorPulse::GetAmplitude(), and TDetectorPulse::kFast.
00106 {return fCentralMuon->GetAmplitude(TDetectorPulse::kFast);}
const TDetectorPulse* TMuonEvent::GetCentralMuon | ( | ) | const [inline] |
Definition at line 107 of file TMuonEvent.h.
References fCentralMuon.
Referenced by PlotTME_activeSiRmuStops::FillHistograms(), and TMEAlgorithm::ActiveSiRStop::operator()().
00107 {return fCentralMuon;}
int TMuonEvent::GetFirstSourceIndex | ( | const IDs::channel & | ch | ) | const |
Definition at line 58 of file TMuonEvent.cpp.
References fPulseLists.
00058 { 00059 for( SourceDetPulseMap::const_iterator i_source=fPulseLists.begin(); 00060 i_source!=fPulseLists.end(); ++i_source){ 00061 if(i_source->first.matches(ch)) 00062 return std::distance( fPulseLists.begin(),i_source); 00063 } 00064 return -1; 00065 }
int TMuonEvent::GetLastSourceIndex | ( | const IDs::channel & | ch | ) | const |
Definition at line 67 of file TMuonEvent.cpp.
References fPulseLists.
00067 { 00068 for( SourceDetPulseMap::const_reverse_iterator i_source=fPulseLists.rbegin(); 00069 i_source!=fPulseLists.rend(); ++i_source){ 00070 if(i_source->first.matches(ch)) 00071 return std::distance( i_source,fPulseLists.rend()); 00072 } 00073 return -1; 00074 }
int TMuonEvent::GetNumSources | ( | ) | const [inline] |
Get the number of sources with pulses in this TME.
Definition at line 53 of file TMuonEvent.h.
References fPulseLists.
00053 {return fPulseLists.size();};
const TDetectorPulse * TMuonEvent::GetPulse | ( | const IDs::source & | detector, | |
int | index | |||
) | const |
Retrieve a pulse from the specified source and position in the pulse list.
Definition at line 19 of file TMuonEvent.cpp.
Referenced by TMEAlgorithm::ActiveSiRStop::operator()().
00019 { 00020 SourceDetPulseMap::const_iterator i_source=fPulseLists.find(source); 00021 if(i_source==fPulseLists.end()) return NULL; 00022 if(index>(int)i_source->second.size() || index<0) throw Except::OutOfRange(); 00023 const TDetectorPulse* pulse= *(i_source->second.begin()+index); 00024 return pulse; 00025 }
const IDs::source & TMuonEvent::GetSource | ( | int | n | ) | const |
Get the n-th source that contains pulses.
Definition at line 40 of file TMuonEvent.cpp.
References fPulseLists.
00040 { 00041 if(n>(int)fPulseLists.size() || n<0) throw Except::OutOfRange(); 00042 SourceDetPulseMap::const_iterator i_source=fPulseLists.begin(); 00043 std::advance(i_source,n); 00044 return i_source->first; 00045 }
int TMuonEvent::GetSourceIndex | ( | const IDs::channel & | ch, | |
int | start = 0 | |||
) | const |
Get the index of the next source to match channel, ch, starting at index start.
The returned index can be used with GetSource and then passed back as the start parameter to loop over all source IDs matching a given channel. If no sources match the channel ID then the returned int is less than 0
Definition at line 47 of file TMuonEvent.cpp.
References fPulseLists.
00047 { 00048 if(start>(int)fPulseLists.size() || start<0) throw Except::OutOfRange(); 00049 SourceDetPulseMap::const_iterator i_source=fPulseLists.begin(); 00050 for(std::advance(i_source,start); 00051 i_source!=fPulseLists.end(); ++i_source){ 00052 if(i_source->first.matches(ch)) 00053 return std::distance( fPulseLists.begin(),i_source); 00054 } 00055 return -1; 00056 }
double TMuonEvent::GetTime | ( | ) | const [inline] |
Get the time of this TME defined as the arrival time of the central muon.
Definition at line 105 of file TMuonEvent.h.
References fCentralMuon, TDetectorPulse::GetTime(), and TDetectorPulse::kFast.
Referenced by FixedWindowMEGenerator::AddPulsesInWindow(), and PlotTME_activeSiRmuStops::FillHistograms().
00105 {return fCentralMuon->GetTime(TDetectorPulse::kFast);}
bool TMuonEvent::HasMuonHit | ( | ) | const |
Does this TME pass the muon hit criteria.
Definition at line 102 of file TMuonEvent.cpp.
References NumPulses().
00102 { 00103 return NumPulses(MuSc); // && NumPulses(MuPCX) && NumPulses(MuPCY); 00104 }
bool TMuonEvent::HasMuonPileup | ( | ) | const |
Does this TME pass the muon pile-up criteria.
Definition at line 106 of file TMuonEvent.cpp.
References NumPulses().
00106 { 00107 return NumPulses(MuSc)>1 ;//|| NumPulses(MuScA)>0; 00108 }
void TMuonEvent::InsertSiliconEvent | ( | LeftRight_t | lr, | |
const TSiliconEvent & | si_evt | |||
) | [inline] |
Definition at line 109 of file TMuonEvent.h.
References fSiliconHits.
Referenced by MakeSiliconEvents::ProcessEntry().
00109 { 00110 fSiliconHits[lr].push_back(si_evt); 00111 }
int TMuonEvent::NumPulses | ( | const IDs::source & | source | ) | const |
Get the number of pulses contained in this TME for a given source.
Definition at line 96 of file TMuonEvent.cpp.
References fPulseLists.
00096 { 00097 SourceDetPulseMap::const_iterator i_source=fPulseLists.find(source); 00098 if(i_source==fPulseLists.end()) return 0; 00099 return i_source->second.size(); 00100 }
int TMuonEvent::NumPulses | ( | const IDs::channel & | channel | ) | const |
Get the number of pulses contained in this TME for a given channel.
If multiple generators are used on the same channel then this returns the number of pulses from all sources. See NumPulses(const IDs::source&)const for an alternative.
Definition at line 87 of file TMuonEvent.cpp.
References fPulseLists.
Referenced by BeginPulses(), EndPulses(), PlotTME_activeSiRmuStops::FillHistograms(), HasMuonHit(), HasMuonPileup(), and TMEAlgorithm::ActiveSiRStop::operator()().
00087 { 00088 int size=0; 00089 for(SourceDetPulseMap::const_iterator i_source=fPulseLists.begin(); 00090 i_source!=fPulseLists.end(); ++i_source){ 00091 if(i_source->first==channel) size+=i_source->second.size(); 00092 } 00093 return size; 00094 }
int TMuonEvent::NumSiHits | ( | LeftRight_t | lr | ) | const [inline] |
Definition at line 114 of file TMuonEvent.h.
References fSiliconHits.
00114 { return fSiliconHits[lr].size();}
void TMuonEvent::Reset | ( | ) | [inline] |
Reset a TME's list of pulses.
Definition at line 39 of file TMuonEvent.h.
References fExhaustedChannels, and fPulseLists.
00039 { 00040 fPulseLists.clear(); 00041 fExhaustedChannels.clear(); 00042 }
int TMuonEvent::TotalNumPulses | ( | ) | const |
Get the total number of pulses contained in this TME.
Definition at line 78 of file TMuonEvent.cpp.
References fPulseLists.
Referenced by MaxTimeDiffMEGenerator::ProcessPulses().
00078 { 00079 int size=0; 00080 for(SourceDetPulseMap::const_iterator i_source=fPulseLists.begin(); 00081 i_source!=fPulseLists.end(); ++i_source){ 00082 size+=i_source->second.size(); 00083 } 00084 return size; 00085 }
bool TMuonEvent::WasEarlyInEvent | ( | ) | const |
Get whether or not this TME is flagged as early in an event.
Definition at line 110 of file TMuonEvent.cpp.
References DEBUG_PRINT.
00110 { 00111 DEBUG_PRINT("TMuonEvent::WasEarlyInEvent is not yet implemented"); 00112 return true; 00113 }
bool TMuonEvent::WasLateInEvent | ( | double | event_length, | |
double | event_uncertainty | |||
) | const |
Get whether or not this TME is flagged as late in an event.
Definition at line 115 of file TMuonEvent.cpp.
References DEBUG_PRINT.
00115 { 00116 DEBUG_PRINT("TMuonEvent::WasLateInEvent is not yet implemented"); 00117 return true; 00118 }
bool TMuonEvent::WereNoPulsesLeft | ( | const IDs::source & | so | ) | const [inline] |
Get whether all pulses for a specific channel were used up.
Definition at line 101 of file TMuonEvent.h.
References fExhaustedChannels.
00101 { 00102 return fExhaustedChannels.find(so)!=fExhaustedChannels.end();};
bool TMuonEvent::WereNoPulsesLeft | ( | ) | const [inline] |
Get whether all pulses for ANY channel were used up.
Definition at line 99 of file TMuonEvent.h.
References fExhaustedChannels.
00099 {return fExhaustedChannels.size()!=0;};
const TDetectorPulse* TMuonEvent::fCentralMuon [private] |
Definition at line 119 of file TMuonEvent.h.
Referenced by GetAmplitude(), GetCentralMuon(), and GetTime().
SourceSet TMuonEvent::fExhaustedChannels [private] |
Definition at line 122 of file TMuonEvent.h.
Referenced by AllPulsesUsed(), Reset(), and WereNoPulsesLeft().
SourceDetPulseMap TMuonEvent::fPulseLists [private] |
Definition at line 117 of file TMuonEvent.h.
Referenced by AddPulse(), AddPulses(), BeginPulses(), EndPulses(), GetFirstSourceIndex(), GetLastSourceIndex(), GetNumSources(), GetSource(), GetSourceIndex(), NumPulses(), Reset(), and TotalNumPulses().
SiliconHitList TMuonEvent::fSiliconHits[2] [private] |
Definition at line 118 of file TMuonEvent.h.
Referenced by BeginSiEvents(), EndSiEvents(), InsertSiliconEvent(), and NumSiHits().
double TMuonEvent::fWindowWidth [private] |
Definition at line 120 of file TMuonEvent.h.