Optionally one can also compile the macro with ACLiC, the CINT interface to the C++ compiler.
#if !defined(__CINT__) || defined(__MAKECINT__)
#include "TCanvas.h"
#include "TGraph.h"
#include "TFile.h"
#include "TAxis.h"
#endif
{
if(!chain->
Add(filename)){
cout<<"Error while reading file: "<<filename<<endl;
return;
}
chain->SetBranchAddress("DAQ@Header.",&header);
chain->SetBranchAddress("DAQ@Pulse.",&pulse);
chain->SetBranchAddress("DAQ@PulseInfo.",&pulseInfo);
if(chain->FindBranch("PulseBasicParameters@MaxBaseline.")) {
chain->SetBranchAddress("PulseBasicParameters@MaxBaseline.",&maxBaseline);
chain->SetBranchAddress("BaselineModule@BaselineData.",&baselineData);
chain->SetBranchAddress("BCountPulses@CountPulsesData.",&countPulses);
}
if(chain->FindBranch("BadPulse@Passed.")) {
chain->SetBranchAddress("BadPulse@Passed.",&badPulse);
chain->SetBranchAddress("TutorialAmplitudeFilter@Passed.",&lFilter);
}
Long64_t nentries = chain->GetEntries();
if(nentries == 0) {
cout<<"Empty files!"<<endl;
return;
}
cout<<"Number of entries: "<<nentries<<endl;
chain->GetEntry(0);
}
cout<<"RunData not valid, not converting from ADC to mV"<<endl;
}
TGraph* pulseGraph = 0;
TCanvas* pulseCanvas = new TCanvas("PulseCanvas","Raw pulse");
for(Long64_t entry = 0; entry < nentries; entry++) {
chain->GetEntry(entry);
cout<<"##############################"<<endl;
cout<<"Entry: "<<entry<<endl;
cout<<"******* Dump of DAQ@Header:"<<endl;
cout<<*header;
cout<<"******* Dump of DAQ@PulseInfo:"<<endl;
cout<<*pulseInfo;
cout<<"******* Dump of DAQ@Pulse"<<endl;
cout<<*pulse;
if(maxBaseline) {
cout<<"******* Dump of analysis quantities:"<<endl;
cout<<
"Max-Baseline : IsValid = "<<maxBaseline->
IsValid()<<
" Value: "<<*maxBaseline<<
" [mV]"<<endl;
cout<<
"Baseline slope : IsValid = "<<baselineData->IsValid()<<
" Value: "<<baselineData->
fBaselineSlope<<
" [mV/ADC sample]"<<endl;
cout<<
"Number of pulses: IsValid = "<<countPulses->IsValid()<<
" Value: "<<countPulses->
GetNumberOfPulses()<<endl;
}
if(badPulse) {
cout<<
"BadPulse@Passed : IsValid = "<<badPulse->
IsValid()<<
" Value: "<<*badPulse<<endl;
cout<<
"AmplFilt@Passed : IsValid = "<<amplFilter->
IsValid()<<
" Value: "<<*amplFilter<<endl;
}
double ADC2mV = -1;
cout<<"ADC2mV = "<<ADC2mV<<endl;
}
samplesmV = pulse->GetSamplesADC();
if(ADC2mV > 0) samplesmV *= ADC2mV;
if(pulseGraph) delete pulseGraph;
pulseGraph->GetXaxis()->SetTitle("sample index");
if(ADC2mV > 0) pulseGraph->GetYaxis()->SetTitle("mV");
else pulseGraph->GetYaxis()->SetTitle("ADC counts");
pulseGraph->Draw("AL");
pulseCanvas->Modified();
pulseCanvas->Update();
cout<<"****************************"<<endl;
cout<<"Press any key to go to next event, \'q\' to interrupt"<<endl;
char p = getchar();
if(p == 'q') return;
}
}
QRunDataHandle rHandle(753)
QChannelRunData chanRunData
void ScanEvents(const char *filename)
base types wrapped into a QObject. Currently implemented types are QInt QDouble and QFloat....
bool wrapped into a QObject
Int_t Add(const char *filename, Long64_t nentries=kBigNumber)
basic channel and run based info. Used in the QRunData object.
double fADC2mV
conversion: mV = ADC * fADC2mV
number of pulses and time interval beetwen peaks in the same acquired window
const int & GetNumberOfPulses() const
Object to manage I/O (DB, file, or memory) of diana global quantities.
void SetOwner(const std::string &owner)
set the module that is accessing this object
void EnableCache(const bool enable)
enable / disable caching of objects
QError Get(const std::string &owner, GlobalHandle< Q > *gh, const std::string &inSource, bool printError=true) const
Get an object using a global handle.
bool IsValid() const
check wheter object is valid
Raw event: bolometer channel, trigger positions and types.
Raw event: sampled waveform.
global handle for QRunData
const QChannelRunData & GetChannelRunData(const int channel) const
get channel based run data quantities
Interface for vectors in Diana analysis.
TGraph * GetGraph(double samplingFrequency=1., double scale=1.) const
Get a root TGraph (owned by the caller)
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...