10 #include <tls/TankResponseFactory.h>
11 #include <tls/VTankResponse.h>
18 #include <utl/Reader.h>
19 #include <utl/AugerUnits.h>
20 #include <utl/AugerException.h>
21 #include <utl/ErrorLogger.h>
24 #include <TBenchmark.h>
30 int main(
int argc,
char* argv[]) {
32 const int nCycles = 10000;
37 cerr <<
"wrong number of arguments, need exactly one which is path to XML configuration file" << endl;
43 vector<Branch> branchList;
48 cout <<
"No. of calls " << nCycles << endl;
50 vector<double> thetaList;
51 vector<double> signalList;
53 for (
int i=0;i<nCycles;++i)
56 signalList.push_back(gRandom->Exp(10.));
59 cout <<
"Calls to PDF(...)" << endl;
60 for (
unsigned short ib=0;ib<branchList.size();++ib)
62 Branch& branch = branchList[ib];
65 VTankResponse& tankResponse = TankResponseFactory::GetInstance().GetTankResponse(branch);
67 msg1 << branch.
GetName() <<
"1";
69 bench.Start(msg1.str().c_str());
70 for (
int i=0;i<nCycles;++i) tankResponse.
PDF(signalList[i], thetaList[i], 0, 1);
71 bench.Stop(msg1.str().c_str());
74 msg2 << branch.
GetName() <<
"20";
76 bench.Start(msg2.str().c_str());
77 for (
int i=0;i<nCycles;++i) tankResponse.
PDF(signalList[i], thetaList[i], 0, 20);
78 bench.Stop(msg2.str().c_str());
81 sprintf(buf,
"%20s - 1 muon : real time %5.2f",branch.
GetName().c_str(),bench.GetRealTime(msg1.str().c_str()));
83 sprintf(buf,
"%20s - 20 muons: real time %5.2f",branch.
GetName().c_str(),bench.GetRealTime(msg2.str().c_str()));
91 cout <<
"Calls to CDF(...)" << endl;
92 for (
unsigned short ib=0;ib<branchList.size();++ib)
94 Branch& branch = branchList[ib];
97 VTankResponse& tankResponse = TankResponseFactory::GetInstance().GetTankResponse(branch);
100 msg1 << branch.
GetName() <<
"1";
102 bench.Start(msg1.str().c_str());
103 for (
int i=0;i<nCycles;++i) tankResponse.
CDF(signalList[i], thetaList[i], 0, 1);
104 bench.Stop(msg1.str().c_str());
107 msg2 << branch.
GetName() <<
"20";
109 bench.Start(msg2.str().c_str());
110 for (
int i=0;i<nCycles;++i) tankResponse.
CDF(signalList[i], thetaList[i], 0, 20);
111 bench.Stop(msg2.str().c_str());
114 sprintf(buf,
"%20s - 1 muon : real time %5.2f",branch.
GetName().c_str(),bench.GetRealTime(msg1.str().c_str()));
116 sprintf(buf,
"%20s - 20 muons: real time %5.2f",branch.
GetName().c_str(),bench.GetRealTime(msg2.str().c_str()));
virtual double PDF(const double signal, const double theta, const double r, const ulong muons) const =0
PDF of signal, given a fixed number of muons.
Base class for exceptions trying to access non-existing components.
Branch GetTopBranch() const
Get the top Branch (represents same entity as document node)
Branch GetNextSibling() const
Get next sibling of this branch.
Utility for parsing XML files.
Class representing a document branch.
Interface class for coupling different tank response calculations into the reconstruction code...
int main(int argc, char *argv[])
std::string GetName() const
function to get the Branch name
Branch GetFirstChild() const
Get first child of this Branch.
#define ERROR(message)
Macro for logging error messages.
const std::string & GetMessage() const
Retrieve the message from the exception.
virtual double CDF(const double smax, const double theta, const double r, const ulong muons) const =0
Probability of signal begin smaller than smax, given a fixed number of muons.