27 #include "CLHEP/Units/SystemOfUnits.h" 35 class StripSplitterAlg;
57 std::array<double, 3> CalculateStripHitPosition(
float x,
float y,
float z, std::pair<float, float>
time,
raw::CellID_t cID);
58 float CorrectStripHitTime(
float x,
float y,
float z, std::pair<float, float> hitTime,
raw::CellID_t cID);
70 std::unique_ptr<rec::alg::StripSplitterAlg>
fSSAAlgo;
79 fGeo = gar::providerFrom<geo::GeometryGAr>();
80 fDetProp = gar::providerFrom<detinfo::DetectorPropertiesService>();
86 fSSAAlgo = std::make_unique<rec::alg::StripSplitterAlg>(fSSAAlgoPars);
91 <<
" Saving Strip ends flag turned on! ";
95 consumes<std::vector<gar::rec::CaloHit>>(tag);
103 std::vector< art::Ptr<gar::rec::CaloHit> > artHits;
111 std::vector<const gar::rec::CaloHit*> splitHits =
fSSAAlgo->getSplitHits();
113 std::vector<const gar::rec::CaloHit*> unsplitHits =
fSSAAlgo->getUnSplitHits();
116 std::unique_ptr< std::vector<gar::rec::CaloHit> > HitCol(
new std::vector<gar::rec::CaloHit>);
120 for(
auto const &it : splitHits) {
123 float energy = it->Energy();
124 std::pair<float, float>
time = it->Time();
126 const float *
pos = it->Position();
127 float newpos[3] = { pos[0], pos[1], pos[2] };
128 float newtime = time.first;
129 unsigned int layer = it->Layer();
130 const std::array<double, 3> point = { pos[0], pos[1], pos[2] };
137 HitCol->emplace_back(hit);
142 for(
auto const &it : unsplitHits) {
145 float energy = it->Energy();
146 std::pair<float, float>
time = it->Time();
148 const float *
pos = it->Position();
149 float newpos[3] = { pos[0], pos[1], pos[2] };
150 float newtime = time.first;
151 unsigned int layer = it->Layer();
152 const std::array<double, 3> point = { pos[0], pos[1], pos[2] };
157 newpos[0] = strip_pos[0];
158 newpos[1] = strip_pos[1];
159 newpos[2] = strip_pos[2];
165 HitCol->emplace_back(hit);
172 std::vector<const gar::rec::CaloHit*> stripEndsHits =
fSSAAlgo->getStripEndsHits();
173 for(
auto const &it : stripEndsHits)
174 HitCol->emplace_back(*it);
176 std::vector<const gar::rec::CaloHit*> stripInterHits =
fSSAAlgo->getIntersectionHits();
177 for(
auto const &it : stripInterHits)
178 HitCol->emplace_back(*it);
190 auto theHits = evt.
getHandle< std::vector<gar::rec::CaloHit> >(itag);
191 if (!theHits)
return;
193 for (
unsigned int i = 0; i < theHits->size(); ++i)
196 hitVector.push_back(hit);
203 std::array<double, 3> point = {
x,
y, z};
204 std::array<double, 3> pointLocal;
210 float xlocal = c * ( time.first - time.second ) / 2.;
213 std::array<double, 3> world_back;
222 std::array<double, 3> point = {
x,
y, z};
226 float time = (hitTime.first + hitTime.second) / 2. - (stripLength / (2 * c));
static constexpr double cm
std::array< double, 3 > CalculateStripHitPosition(float x, float y, float z, std::pair< float, float > time, raw::CellID_t cID)
bool WorldToLocal(std::array< double, 3 > const &world, std::array< double, 3 > &local, gar::geo::LocalTransformation< TGeoHMatrix > &trans) const
std::string fInstanceName
product instance name
void produce(art::Event &e) override
Handle< PROD > getHandle(SelectorBase const &) const
const geo::GeometryCore * fGeo
pointer to the geometry
CaloStripSplitter(fhicl::ParameterSet const &p)
std::unique_ptr< rec::alg::StripSplitterAlg > fSSAAlgo
const std::string instance
void CollectHits(const art::Event &evt, const std::string &label, const std::string &instance, std::vector< art::Ptr< gar::rec::CaloHit > > &hitVector)
Description of geometry of one entire detector.
double getStripLength(const std::array< double, 3 > &point, const gar::raw::CellID_t &cID) const
const detinfo::DetectorProperties * fDetProp
detector properties
bool isTile(const std::array< double, 3 > &point, const gar::raw::CellID_t &cID) const
#define DEFINE_ART_MODULE(klass)
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={})
float CorrectStripHitTime(float x, float y, float z, std::pair< float, float > hitTime, raw::CellID_t cID)
#define MF_LOG_INFO(category)
std::string fCaloHitLabel
label to find the right reco calo hits
General GArSoft Utilities.
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
art framework interface to geometry description