36 int main(
int argc,
char **argv) {
37 const unsigned int max_multiplicity = 31 ;
60 catch(
const exception &error) {
61 cerr << error.what() << endl ;
62 cout <<
"Use option -h! to display command line options." << endl ;
74 cerr <<
"FATAL ERROR. Could not open detector file '" << detectorFile <<
"'." << endl ;
82 const int ncolors = 5 ;
83 const int nice_colors[ncolors] = { kRed, kBlue, kBlack, kViolet, kCyan } ;
88 for(
unsigned int m=0; m<max_multiplicity+1; ++m ) {
90 sprintf( hname,
"hToT_m%u", m ) ;
92 sprintf( htitle,
"Exclusive %u-fold coincidence clusters;ToT [ns];a.u. (normalized)", m ) ;
93 hToT[m] =
new TH1D( hname, htitle, 256, -0.5, 255.5 ) ;
94 hToT[m]->SetLineColor( nice_colors[m%ncolors] ) ;
95 hToT[m]->SetLineWidth(2) ;
100 for(
unsigned int m=0; m<max_multiplicity+1; ++m ) {
102 sprintf( hname,
"ht_m%u", m ) ;
104 sprintf( htitle,
"Exclusive %u-fold coincidence clusters;Time after first hits [ns];a.u. (normalized)", m ) ;
105 const int margin = 5 ;
106 double xmin = -margin ;
107 double xmax = ceil(window) + margin ;
108 int nbins = (int) round(
xmax-
xmin) ;
109 ht[m] =
new TH1D( hname, htitle, nbins,
xmin,
xmax ) ;
110 ht[m]->SetLineColor( nice_colors[m%ncolors] ) ;
111 ht[m]->SetLineWidth(2) ;
117 TH2D hSizeVsMultiplicity(
"hSizeVsMultiplicity",
";cluster size;cluster multiplicity",
120 hSizeVsMultiplicity.SetOption(
"colz") ;
126 cout <<
"---------- Reading file(s) ----------" << endl ;
132 unsigned int nTS = 0 ;
135 if( (
int)nTS == maxnslices ) break ;
139 cout <<
"------ Frame index = " << ts->
getFrameIndex() << endl ;
143 for(JDAQTimeslice::const_iterator sf = ts->begin() ; sf!=ts->end() ; ++sf ) {
145 if( sf->size() == 0 ) continue ;
147 int moduleID = sf->getModuleID() ;
152 cluster_builder.
reset(*sf,module) ;
156 cout <<
"--- " <<
"S" << module.
getString() <<
"F" << module.
getFloor() << endl ;
157 cout << setw(10) <<
"multiplicity"
158 << setw(20) <<
"excl. nclusters"
159 << setw(20) <<
"incl. nclusters"
161 for(
unsigned int m=2; m<=max_multiplicity; ++m) {
163 cout << setw(10) << m
177 hSizeVsMultiplicity.Fill( it->size(), it->getMultiplicity() ) ;
185 for(
unsigned int m=0; m<=max_multiplicity; ++m) {
188 for( JHitL1::const_iterator hit=it->begin(); hit!=it->end(); ++hit ) {
189 hToT[m]->Fill( hit->getToT() ) ;
192 if( it->size() > 1 ) {
193 JHitL1::const_iterator first_hit = it->begin() ;
194 JHitL1::const_iterator hit(first_hit) ;
195 for( ++hit; hit!=it->end(); ++hit ) {
196 ht[m]->Fill( hit->getT() - first_hit->getT() ) ;
208 cout <<
"Read " << nTS <<
" time slices." << endl ;
210 TFile* f =
new TFile( ofname.c_str(),
"recreate" ) ;
212 hSizeVsMultiplicity.Write() ;
214 for(
unsigned int m=0; m<=max_multiplicity; ++m) {
215 if( hToT[m]->GetEntries()>0 ) {
217 hToT[m]->Scale( 1.0/hToT[m]->Integral() ) ;
221 if( ht[m]->GetEntries()>0 ) {
223 ht[m]->Scale( 1.0/ht[m]->Integral() ) ;
231 cout <<
"Output in '" << ofname <<
"'." << endl ;
int main(int argc, char **argv)
KM3NeT DAQ constants, bit handling, etc.
Data structure for detector geometry and calibration.
Direct access to module in detector data structure.
Scanning of objects from multiple files according a format that follows from the extension of each fi...
Utility class to parse command line options.
#define make_field(A,...)
macro to convert parameter to JParserTemplateElement object
ROOT TTree parameter settings of various packages.
int getFloor() const
Get floor number.
int getString() const
Get string number.
int first
index of module in detector data structure
Router for direct addressing of module data in detector data structure.
const JModuleAddress & getAddress(const JObjectID &id) const
Get address of module.
Data structure for a composite optical module.
Local coincidence cluster builder.
vector< JCluster >::const_iterator end_inclusive_m(unsigned int multiplicity) const
returns end iterator for clusters with at least the given multiplicity
void reset(const JDAQSuperFrame &frame, const JModule &module)
This is a way to re-use the allocated memory.
vector< JCluster >::const_iterator end_m(unsigned int multiplicity) const
returns end iterator for clusters with exactly the given multiplicity
unsigned int getInclusiveNclusters(const unsigned int multiplicity) const
return the number of clusters with at least the given multiplicity
vector< JCluster >::const_iterator begin_inclusive_m(unsigned int multiplicity) const
returns begin iterator for clusters with at least the given multiplicity
vector< JCluster >::const_iterator begin_m(unsigned int multiplicity) const
returns begin iterator for clusters with exactly the given multiplicity
unsigned int getNclusters(const unsigned int multiplicity) const
return the number of clusters with exactly the given multiplicity
Utility class to parse command line options.
virtual bool hasNext() override
Check availability of next element.
virtual const pointer_type & next() override
Get next element.
int getFrameIndex() const
Get frame index.
file Auxiliary data structures and methods for detector calibration.
void load(const std::string &file_name, JDetector &detector)
Load detector from input file.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary classes and methods for triggering.
KM3NeT DAQ data structures and auxiliaries.