29 #if !defined(__CINT__) || defined(__MAKECINT__)
49 using namespace Diana;
57 if(!chain->
Add(filename)){
58 cout<<
"Error while reading file: "<<filename<<endl;
67 chain->SetBranchAddress(
"DAQ@Header.",&header);
68 chain->SetBranchAddress(
"DAQ@Pulse.",&pulse);
69 chain->SetBranchAddress(
"DAQ@PulseInfo.",&pulseInfo);
74 if(chain->FindBranch(
"PulseBasicParameters@MaxBaseline.")) {
75 chain->SetBranchAddress(
"PulseBasicParameters@MaxBaseline.",&maxBaseline);
76 chain->SetBranchAddress(
"BaselineModule@BaselineData.",&baselineData);
77 chain->SetBranchAddress(
"BCountPulses@CountPulsesData.",&countPulses);
81 QBool* amplFilter = 0;
82 if(chain->FindBranch(
"BadPulse@Passed.")) {
83 chain->SetBranchAddress(
"BadPulse@Passed.",&badPulse);
84 chain->SetBranchAddress(
"TutorialAmplitudeFilter@Passed.",&lFilter);
88 Long64_t nentries = chain->GetEntries();
90 cout<<
"Empty files!"<<endl;
93 cout<<
"Number of entries: "<<nentries<<endl;
97 Int_t run = header->
GetRun();
110 cout<<
rHandle.GetError()<<endl;
111 cout<<
"RunData not valid, not converting from ADC to mV"<<endl;
115 TGraph* pulseGraph = 0;
117 TCanvas* pulseCanvas =
new TCanvas(
"PulseCanvas",
"Raw pulse");
120 for(Long64_t entry = 0; entry < nentries; entry++) {
122 chain->GetEntry(entry);
125 cout<<
"##############################"<<endl;
126 cout<<
"Entry: "<<entry<<endl;
127 cout<<
"******* Dump of DAQ@Header:"<<endl;
129 cout<<
"******* Dump of DAQ@PulseInfo:"<<endl;
131 cout<<
"******* Dump of DAQ@Pulse"<<endl;
135 cout<<
"******* Dump of analysis quantities:"<<endl;
136 cout<<
"Max-Baseline : IsValid = "<<maxBaseline->
IsValid()<<
" Value: "<<*maxBaseline<<
" [mV]"<<endl;
137 cout<<
"Baseline slope : IsValid = "<<baselineData->IsValid()<<
" Value: "<<baselineData->
fBaselineSlope<<
" [mV/ADC sample]"<<endl;
138 cout<<
"Number of pulses: IsValid = "<<countPulses->IsValid()<<
" Value: "<<countPulses->
GetNumberOfPulses()<<endl;
141 cout<<
"BadPulse@Passed : IsValid = "<<badPulse->
IsValid()<<
" Value: "<<*badPulse<<endl;
142 cout<<
"AmplFilt@Passed : IsValid = "<<amplFilter->
IsValid()<<
" Value: "<<*amplFilter<<endl;
151 cout<<
"ADC2mV = "<<ADC2mV<<endl;
157 samplesmV = pulse->GetSamplesADC();
158 if(ADC2mV > 0) samplesmV *= ADC2mV;
162 if(pulseGraph)
delete pulseGraph;
163 pulseGraph = samplesmV.GetGraph();
164 pulseGraph->GetXaxis()->SetTitle(
"sample index");
165 if(ADC2mV > 0) pulseGraph->GetYaxis()->SetTitle(
"mV");
166 else pulseGraph->GetYaxis()->SetTitle(
"ADC counts");
167 pulseGraph->Draw(
"AL");
169 pulseCanvas->Modified();
170 pulseCanvas->Update();
173 cout<<
"****************************"<<endl;
174 cout<<
"Press any key to go to next event, \'q\' to interrupt"<<endl;
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
the Diana namespace is needed because sometimes we use Qt libraries, that use same class names of our...