27 #include "Geometry/LocalTransformation.h" 32 #include "CLHEP/Units/SystemOfUnits.h" 35 #include "TGeoManager.h" 96 fGeo = gar::providerFrom<geo::GeometryGAr>();
97 fDetProp = gar::providerFrom<detinfo::DetectorPropertiesService>();
98 fSiPMUtils = std::make_unique<util::SiPMUtils>(fDetProp->EffectivePixel());
100 std::string fEncoding = fGeo->GetECALCellIDEncoding();
102 consumes< std::vector<raw::CaloRawDigit> >(tag);
106 if(fInstanceLabelName.compare(
"MuID") == 0) {
107 fEncoding = fGeo->GetMuIDCellIDEncoding();
108 fSamplingCorrection =
p.get<
float>(
"MuIDSamplingFactorGeV", 1.0);
117 std::unique_ptr< std::vector<rec::CaloHit> > hitCol (
new std::vector< rec::CaloHit > );
121 std::vector< art::Ptr<gar::raw::CaloRawDigit> > artDigiHits;
131 unsigned int hitADC = digitHit.
ADC().first;
132 std::pair<float, float> hitTime = digitHit.
Time();
133 float x = digitHit.
X();
134 float y = digitHit.
Y();
135 float z = digitHit.
Z();
153 double unsat_px =
fSiPMUtils->DeSaturate(sat_px);
165 float pos[3] = {0., 0., 0.};
166 std::pair<float, float>
time;
167 const std::array<double, 3> point = {
x,
y, z };
179 pos[0] = strip_pos[0];
180 pos[1] = strip_pos[1];
181 pos[2] = strip_pos[2];
182 time = std::make_pair( this->
CorrectStripHitTime(pos[0], pos[1], pos[2], hitTime, cellID), 0. );
194 hitCol->emplace_back(hit);
197 <<
" with cellID " << cellID
199 <<
" pos (" << pos[0] <<
", " << pos[1] <<
", " << pos[2] <<
")";
203 RecoDigiHitsAssns->addSingle(hitPtr, digiArtPtr);
217 auto theHits = evt.
getHandle< std::vector<gar::raw::CaloRawDigit> >(itag);
218 if (!theHits)
return;
220 for (
unsigned int i = 0; i < theHits->size(); ++i)
223 hitVector.push_back(hit);
231 float calibrated_ADC = 0.;
233 return calibrated_ADC;
237 return calibrated_ADC;
243 float calibrated_MIP = 0.;
245 return calibrated_MIP;
248 TVector3 point(x, y, z);
252 return calibrated_MIP;
258 std::array<double, 3> point = {
x,
y, z};
259 std::array<double, 3> pointLocal;
267 float xlocal = c * ( hitTime.first - hitTime.second ) / 2.;
270 std::array<double, 3> world_back;
279 std::array<double, 3> point = {
x,
y, z};
283 float time = (hitTime.first + hitTime.second) / 2. - (stripLength / (2 * c));
static constexpr double cm
SiPMHitFinder & operator=(SiPMHitFinder const &)=delete
float fMIPThreshold
zero-suppression threshold (in case the raw digits need to be zero-suppressed)
virtual double SiPMGain() const =0
float CalibratetoMeV(float x, float y, float z, double MIP)
bool WorldToLocal(std::array< double, 3 > const &world, std::array< double, 3 > &local, gar::geo::LocalTransformation< TGeoHMatrix > &trans) const
float GetSensVolumeThickness(const TVector3 &point) const
std::pair< float, float > Time() const
Timestmap.
gar::geo::BitFieldCoder const * fFieldDecoder
float Y() const
Y position.
std::pair< unsigned int, unsigned int > ADC() const
Reference to the compressed ADC count vector.
void CollectDigiHits(const art::Event &evt, const std::string &label, const std::string &instance, std::vector< art::Ptr< gar::raw::CaloRawDigit > > &hitVector)
Handle< PROD > getHandle(SelectorBase const &) const
EDProducer(fhicl::ParameterSet const &pset)
float CorrectStripHitTime(float x, float y, float z, std::pair< float, float > hitTime, raw::CellID_t cID)
float X() const
X position.
const std::string instance
Description of geometry of one entire detector.
static constexpr double MeV
double getStripLength(const std::array< double, 3 > &point, const gar::raw::CellID_t &cID) const
std::string fInstanceLabelName
product instance name
std::array< double, 3U > CalculateStripHitPosition(float x, float y, float z, std::pair< float, float > hitTime, raw::CellID_t cID)
bool isTile(const std::array< double, 3 > &point, const gar::raw::CellID_t &cID) const
#define DEFINE_ART_MODULE(klass)
void produce(art::Event &e) override
static constexpr double GeV
CellID_t CellID() const
cellID
Helper class for decoding and encoding a bit field of 64bits for convenient declaration.
Interface to SiPMReadoutSimAlg class for SiPM specific.
virtual double LightYield() const =0
bool LocalToWorld(std::array< double, 3 > const &local, std::array< double, 3 > &world, gar::geo::LocalTransformation< TGeoHMatrix > const &trans) const
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
Definition of basic calo raw digits.
bool fUseTimePositionReco
const geo::GeometryCore * fGeo
pointer to the geometry
bool fDesaturation
flag to perform the SiPM desaturation
virtual double MeVtoMIP() const =0
General GArSoft Utilities.
long64 get(long64 bitfield, size_t index) const
float fSamplingCorrection
const detinfo::DetectorProperties * fDetProp
detector properties
float CalibrateToMIP(unsigned int ADC)
std::array< double, 3 > ReconstructStripHitPosition(const std::array< double, 3 > &point, const std::array< double, 3 > &local, const float &xlocal, const gar::raw::CellID_t &cID) const
static constexpr double mm
SiPMHitFinder(fhicl::ParameterSet const &p)
art framework interface to geometry description
std::unique_ptr< util::SiPMUtils > fSiPMUtils
pointer to the Util fcn containing the SiPM desaturation function
float Z() const
Z position.
std::string fRawDigitLabel
label to find the right raw digits
QTextStream & endl(QTextStream &s)