28 string outputFilename =
GetString(
"OutputFilename",
"multiple.root");
29 fOutputFile =
new TFile(outputFilename.c_str(),
"recreate");
30 fTree =
new TTree(
"MultipleTree",
"Multiple Events");
31 fTree->Branch(
"multiple_event_branch.",
"Diana::QMultiple", &
fMultiple);
36 fOutput.open (
"Rates.txt", ios::out | ios::app);
38 fDeltaT.open(
"DeltaT.txt", ios::out);
40 for (
int A1=1;A1<69;A1++)
60 for (
int A1=1;A1<69;A1++)
67 for (
int A1=1;A1<69;A1++)
80 const QRawEvent& CurrentRawEvent = ev->GetRawEvent();
83 double CurrentEnergy = ev->GetCalib().GetEnergy();
86 unsigned long long CurrentChannel = CurrentRawEvent.GetPulse().GetChannelId();
89 int Trigger = CurrentRawEvent.GetPulse().GetIsHeater();
94 int Pulses = ev->GetCountPulses().GetNumberOfPulses();
98 unsigned long long CurrentTime = CurrentRawEvent.GetTime().GetFromStartRunNs();
101 if (Pulses==1&&Trigger==0&&CurrentEnergy>=200&&CurrentChannel!=3)
103 CurrentTime =
fFineTime->GetCrossingTime(ev);
108 CurrentTime += (
unsigned long long)
fFineTime->GetCorrection(CurrentChannel);
112 fRun=CurrentRawEvent.GetRun();
114 else if (
fRun!=CurrentRawEvent.GetRun()) {
CallReset(CurrentRawEvent.GetRun());}
116 float Allowed = 20e6;
131 unsigned long long DeltaT =
fLastTime-CurrentTime;
135 if (Pulses==1&&Trigger==0&&CurrentEnergy>=200&&CurrentChannel!=3)
137 if (ev->GetPreProcess().GetIsSaturatedHigh()==1) {
fSaturated++;}
145 DeltaT= (
unsigned long long)
pow(DeltaT,0.5);
159 else if (DeltaT<Allowed&&DeltaT>-Allowed&&TimeCheck==1)
173 for (
int A2=0;A2<
fMultiple->GetMultiplicity();A2++)
175 int TaggedChannel =
fMultiple->GetEventChannelID(A2);
177 if (
MTime[TaggedChannel]==0) {
MTime[TaggedChannel]=CurrentTime;}
179 const QBaseRawEventR* HolderRawEvent =
fMultiple->GetEvent(0).GetBaseRawEvent();
181 for (
int A2=0;A2<
fMultiple->GetMultiplicity();A2++)
199 if (
MTime[CurrentChannel]==0)
203 else if (CurrentTime-
MTime[CurrentChannel]<1e12)
206 if (
AMCount[CurrentChannel]==1)
208 AMTime[CurrentChannel]=CurrentTime-
MTime[CurrentChannel];
226 for (
int A1=1;A1<69;A1++)
Diana::QComplex pow(const Diana::QComplex &z, double a)
Raise a complex number to a real power.
#define REGISTER_MODULE(clazz)
MTimeEnergy(QSequence *s)
virtual QEvent * Do(QEvent *ev)
virtual void CallReset(int run)
unsigned long long MTime[69]
unsigned long long AMTime[69]
virtual void Done()
Done method is called after event loop.
unsigned long long fLastTime
unsigned long long TimeHolder[69]
const std::string & GetString(const std::string &parname, const std::string &defVal, bool warnCfg=true) const
Get a string parameter from config file ( see GetDouble() )
unsigned int GetReadNumber() const
return the event number as read by the current reader.
Base class for diana modules.
Diana Reconstruction program.