5 #include <utl/ErrorLogger.h>
6 #include <utl/TimeDistribution.h>
7 #include <utl/TimeDistributionAlgorithm.h>
10 #include <utl/Particle.h>
12 #include <evt/Event.h>
14 #include <sevt/SEvent.h>
15 #include <sevt/Station.h>
17 #include <sevt/PMTSimData.h>
18 #include <sevt/StationSimData.h>
20 #include <det/Detector.h>
21 #include <sdet/SDetector.h>
22 #include <sdet/Station.h>
24 #include <evt/ShowerSimData.h>
26 #include <fwk/CentralConfig.h>
34 using namespace ShowerInventorAnalyzerNS;
40 INFO(
"ShowerInventorAnalyzer::Init()");
43 CentralConfig::GetInstance()->
GetTopBranch(
"ShowerInventorAnalyzer");
54 INFO(
"ShowerInventorAnalyzer::Run()");
60 double zen = shower.GetZenith();
61 cout <<
"----> in analyzer: zenith = " << zen/
deg << endl;
65 ostringstream peHistTitleSm;
66 peHistTitleSm <<
"integrated pe number for zenith : " << zen/
deg;
67 string peHistTitle(peHistTitleSm.str());
70 if (fTankHistos.find(peHistTitle) == fTankHistos.end()) {
71 peHist =
new TH1F(peHistTitle.c_str(),
75 peHist = fTankHistos[peHistTitle];
80 ostringstream nMuHistTitleSr;
81 nMuHistTitleSr <<
"muon number for zenith : " << zen/
deg;
82 string nMuHistTitle(nMuHistTitleSr.str());
85 if (fTankHistos.find(nMuHistTitle) == fTankHistos.end()) {
86 nMuHist =
new TH1F(nMuHistTitle.c_str(),
90 nMuHist = fTankHistos[nMuHistTitle];
93 const SEvent& sevent =
event.GetSEvent();
97 if (sIt->HasSimData()) {
103 bool stationIsHit =
false;
105 for (Station::ConstPMTIterator pmtIt = sIt->PMTsBegin();
106 pmtIt != sIt->PMTsEnd(); ++pmtIt) {
107 if (pmtIt->HasSimData())
115 cout <<
"number of muons " << nMu << endl;
118 for (Station::ConstPMTIterator pmtIt = sIt->PMTsBegin();
119 pmtIt != sIt->PMTsEnd(); ++pmtIt) {
121 if (!pmtIt->HasSimData())
124 const PMTSimData& pmtSim = pmtIt->GetSimData();
131 sumPe += TimeDistributionAlgorithm::Sum(peDistro, peDistro.
GetStart(), peDistro.
GetStop());
139 const sdet::Station& detStat = det::Detector::GetInstance().GetSDetector().GetStation(*sIt);
144 double radius2 =
Sqr(xyz.get<0>()) +
Sqr(xyz.get<1>());
146 peHist->Fill(
sqrt(radius2), sumPe);
147 nMuHist->Fill(
sqrt(radius2), nMu);
153 fTankHistos[peHistTitle] = peHist;
154 fTankHistos[nMuHistTitle] = nMuHist;
161 ShowerInventorAnalyzer::Finish()
163 INFO(
"ShowerInventorAnalyzer::Finish()");
165 cout <<
"creating file : " << fOutFile << endl;
167 TFile fOutputFile(fOutFile.c_str() ,
"recreate");
169 for (map<string, TH1F*>::iterator lIt = fTankHistos.begin();
170 lIt != fTankHistos.end(); ++lIt) {
171 lIt->second->Write();
Branch GetTopBranch() const
utl::CoordinateSystemPtr GetLocalCoordinateSystem() const
Get the Auger coordinate system associated to the shower core position.
int GetStart() const
First slot with data.
Station Level Simulated Data
StationIterator StationsEnd()
End of all stations.
constexpr T Sqr(const T &x)
Detector description interface for Station-related data.
Interface class to access to the SD part of an event.
Histogram class for time distributions with suppressed empty bins.
#define INFO(message)
Macro for logging informational messages.
void Init()
Initialise the registry.
Branch GetChild(const std::string &childName) const
Get child of this Branch by child name.
bool HasPETimeDistribution(const StationConstants::SignalComponent source=StationConstants::eTotal) const
Check if a PE release time distribution exists (optionally for a given source)
utl::Point GetPosition() const
Tank position.
Interface class to access Shower Simulated parameters.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Class representing a document branch.
boost::tuple< double, double, double > Triple
Coordinate triple for easy getting or setting of coordinates.
int GetStop() const
Last slot with data (1 less than First slot if no data)
void GetData(bool &b) const
Overloads of the GetData member template function.
ResultFlag
Flag returned by module methods to the RunController.
StationIterator StationsBegin()
Beginning of all stations.
Class to hold simulated data at PMT level.
unsigned int GetNumberOfMuons() const
Get the number of muons whose trajectories intersected the WCD.
utl::TimeDistributionI & GetPETimeDistribution(const StationConstants::SignalComponent source=StationConstants::eTotal)
Simulated photoelectron time distribution.
boost::indirect_iterator< InternalConstStationIterator, const Station & > ConstStationIterator
utl::CoordinateSystemPtr GetShowerCoordinateSystem() const