2 #define WCSimWCDigi_h 1
5 #include "G4TDigiCollection.hh"
6 #include "G4Allocator.hh"
7 #include "G4ThreeVector.hh"
8 #include "G4LogicalVolume.hh"
21 #include <ext/functional>
22 using __gnu_cxx::compose2;
37 inline void*
operator new(size_t);
38 inline void operator delete(
void*);
57 std::map<int,double>
pe;
87 inline void SetPe(G4int gate, G4double Q) {
pe[gate] = Q;};
88 inline void SetTime(G4int gate, G4double T) {
time[gate] = T;};
94 fDigiComp[digi_number].push_back(photon_number);
106 inline G4double
GetPe(
int gate) {
return pe[gate];};
123 void SetRot (G4RotationMatrix rotMatrix) {
rot = rotMatrix; };
141 double index_time,index_timepresmear,index_pe;
142 std::vector<int> index_digicomp;
143 int index_primaryparentid;
144 for (i = 1; i < (int)
time.size(); ++i)
146 index_time =
time[i];
151 for (j = i; j > 0 &&
time[j-1] > index_time; j--) {
160 time[j] = index_time;
171 for (i = 1; i < array_size; ++i)
174 for (j = i; j > 0 && a[j-1] > index; j--)
185 std::vector<G4double>::iterator tfirst =
time_double.begin();
186 std::vector<G4double>::iterator tlast =
time_double.end();
188 std::vector<G4double>::iterator found =
189 std::find_if(tfirst,tlast,
190 compose2(std::logical_and<bool>(),
191 std::bind2nd(std::greater_equal<G4double>(),low),
192 std::bind2nd(std::less_equal<G4double>(),upevent)
195 if ( found != tlast ) {
217 inline void* WCSimWCDigi::operator
new(size_t)
224 inline void WCSimWCDigi::operator
delete(
void* aDigi)
int operator==(const WCSimWCDigi &) const
void SetMaxPe(G4int number=0)
void SetPreSmearTime(G4int gate, G4double T)
void SetLogicalVolume(G4LogicalVolume *logV)
void SetRot(G4RotationMatrix rotMatrix)
G4Allocator< WCSimWCDigi > WCSimWCDigiAllocator
void SortArrayByHitTime()
std::map< int, std::vector< int > > GetDigiCompositionInfo()
std::vector< G4double > time_double
Same information as "time" but stored in a vector for quick time sorting.
void AddPhotonToDigiComposition(int digi_number, int photon_number)
const WCSimWCDigi & operator=(const WCSimWCDigi &)
bool operator()(const WCSimWCDigi *const &a, const WCSimWCDigi *const &b) const
void SetTrackID(G4int track)
void SetTubeID(G4int tube)
G4double GetFirstHitTimeInGate(G4double low, G4double upevent)
G4LogicalVolume * GetLogicalVolume()
std::map< int, double > time_presmear
Time of each Digi, before smearing.
void SetPe(G4int gate, G4double Q)
std::map< int, double > time
Time of each Digi.
G4TDigiCollection< WCSimWCDigi > WCSimWCDigitsCollection
void AddDigiCompositionInfo(std::vector< int > &digi_comp)
bool HasHitsInGate(int number)
void AddGate(int g, double t)
void RemoveDigitizedGate(G4int gate)
void insertionSort(int a[], int array_size)
std::map< int, double > pe
Charge of each Digi.
std::vector< double > TriggerTimes
void SetEdep(G4double de)
void AddPe(G4double hitTime)
G4double GetPreSmearTime(int gate)
std::map< int, std::vector< int > > fDigiComp
IDs of the hits that make up this Digit (do not use for Hits)
std::map< int, G4int > primaryParentID
Primary parent ID of the Hit (do not use for Digits)
void SetPos(G4ThreeVector xyz)
void SetTime(G4int gate, G4double T)
void SetParentID(G4int gate, G4int parent)
G4double GetGateTime(int gate)
G4double GetTime(int gate)
G4int GetParentID(int gate)