1 #include <utl/ErrorLogger.h>
2 #include <fwk/CentralConfig.h>
4 #include <det/Detector.h>
5 #include <mdet/MDetector.h>
6 #include <mdet/Counter.h>
7 #include <mdet/Module.h>
10 #include <mevt/MEvent.h>
11 #include <mevt/Counter.h>
12 #include <sevt/SEvent.h>
14 #include <evt/ShowerRecData.h>
15 #include <evt/ShowerSRecData.h>
16 #include <evt/ShowerMRecData.h>
17 #include <mevt/Scintillator.h>
19 #include <utl/Branch.h>
20 #include <utl/ConfigUtils.h>
21 #include <utl/CoordinateSystemPtr.h>
23 #include <fwk/LocalCoordinateSystem.h>
31 using namespace MdCornerClippingCorrecterAG;
33 namespace MdCornerClippingCorrecterAG {
34 MdCornerClippingCorrecter::MdCornerClippingCorrecter()
37 MdCornerClippingCorrecter::~MdCornerClippingCorrecter()
45 LoadConfig(config,
"computeCornerClippingProbability", fComputeCornerClippingProbability,
false);
51 std::ostringstream os;
52 os <<
"\ncomputeCornerClippingProbability = " << fComputeCornerClippingProbability <<
'\n'
53 <<
"par0 = " << fPar0 <<
'\n'
54 <<
"par1 = " << fPar1 <<
'\n'
55 <<
"par2 = " << fPar2 <<
'\n'
56 <<
"par3 = " << fPar3;
65 if (!fComputeCornerClippingProbability) {
66 INFO(
"No corner clipping probability will be computed.");
71 WARNING(
"Event without MEvent: nothing to be done. Skipping to next event.");
78 const mdet::MDetector& md = det::Detector::GetInstance().GetMDetector();
80 std::ostringstream os;
84 const int counterId = counter.
GetId();
88 os <<
"No corner clipping probability for the rejected counter " << counterId <<
".";
95 os <<
"No corner clipping probability for the silent counter " << counterId <<
".";
101 os <<
"Processing counter " << counterId;
110 const int moduleId = module.
GetId();
113 os <<
"Processing module " << moduleId;
120 os <<
"Module " << module.
GetId() <<
" of counter " << counterId
126 FillCornerClippingProbability(event, module, mdm);
134 MdCornerClippingCorrecter::Finish()
148 const double cosTheta = rAxis.
GetCosTheta(coreLocalCS);
155 const double sindphi =
std::abs(std::sin(phi-phi0));
156 const double m = fPar0 + fPar1 / cosTheta;
157 const double b = fPar2 + fPar3 / cosTheta;
158 const double pcc = b + m*sindphi;
164 std::ostringstream os;
165 os <<
"phi = " << phi <<
" rad, "
166 "phi = " << phi /
utl::deg <<
" deg, "
167 "phi0 = " << phi0 <<
" rad, "
168 "phi0 = " << phi0 /
utl::deg <<
" deg, "
169 "sin(phi-phi0) = " << sindphi <<
", "
170 "cosTheta = " << cosTheta <<
", "
Module level reconstruction data. This class contains all data required by the muon reconstruction...
const Module & GetModule(const int mId) const
Retrieve by id a constant module.
CounterConstIterator CountersBegin() const
double GetPhi(const CoordinateSystemPtr &coordinateSystem) const
azimuth (phi) angle in spherical and cylindrical coordinates
Interface class to access to the SD Reconstruction of a Shower.
Counter level event data.
double GetCosTheta(const CoordinateSystemPtr &coordinateSystem) const
cos of zenith (theta) angle
std::string GetRejectionReason() const
#define INFO(message)
Macro for logging informational messages.
void Init()
Initialise the registry.
bool IsRejected() const
Check if the counter is rejected.
bool IsSilent() const
Check if the counter is silent.
Detector associated to muon detector hierarchy.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Class representing a document branch.
double abs(const SVector< n, T > &v)
#define DEBUGLOG(message)
Macro for logging debugging messages.
const utl::Vector & GetAxis() const
#define WARNING(message)
Macro for logging warning messages.
ModuleConstIterator ModulesBegin() const
Root detector of the muon detector hierarchy.
ResultFlag
Flag returned by module methods to the RunController.
int GetId() const
The id of the counter.
ModuleConstIterator ModulesEnd() const
static CentralConfig * GetInstance()
Use this the first time you get an instance of central configuration.
ModuleRecData & GetRecData()
void LoadConfig(const utl::Branch &b, const std::string &tag, T1 &var, const T2 &defaultValue)
Helper method to load a particular configuration parameter.
CounterConstIterator CountersEnd() const
const utl::Point & GetCorePosition() const
const Counter & GetCounter(int id) const
Retrieve Counter by id.
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.
Root of the Muon event hierarchy.
utl::Branch GetTopBranch(const std::string &id)
Get top branch for moduleConfigLink with given id (XML files)
void SetCornerClippingProbability(const double p)