1 #ifndef CRTHITRECOALG_H_SEEN
2 #define CRTHITRECOALG_H_SEEN
11 #include "art/Framework/Principal/Event.h"
12 #include "art/Framework/Core/ModuleMacros.h"
13 #include "fhiclcpp/ParameterSet.h"
14 #include "art/Framework/Principal/Handle.h"
15 #include "canvas/Persistency/Common/Ptr.h"
16 #include "canvas/Persistency/Common/PtrVector.h"
17 #include "art/Framework/Services/Registry/ServiceHandle.h"
18 #include "art_root_io/TFileService.h"
19 #include "art_root_io/TFileDirectory.h"
20 #include "messagefacility/MessageLogger/MessageLogger.h"
21 #include "canvas/Persistency/Common/FindManyP.h"
33 #include "messagefacility/MessageLogger/MessageLogger.h"
34 #include "fhiclcpp/ParameterSet.h"
35 #include "fhiclcpp/types/Table.h"
36 #include "fhiclcpp/types/Atom.h"
37 #include "cetlib/pow.h"
59 #include "TGeoManager.h"
69 const pair<int,ULong64_t> &b)
71 return (a.second < b.second);
86 Name(
"UseReadoutWindow"),
87 Comment(
"Only reconstruct hits within readout window")
91 Comment(
"Pedestal offset [ADC]")
95 Comment(
"Pedestal slope [ADC/photon]")
111 Comment(
"file name for output CSV File")
115 Comment(
"group velocity in WLS fiber [ns/cm]")
119 Comment(
"threshold in photoelectrons above which charge amplitudes used in hit reco")
123 Comment(
"Dummy Gain value for Top CRT")
127 Comment(
"Dummy Pedestal value for Top CRT")
130 Name(
"SiPMtoFEBdelay"),
131 Comment(
"Delay for SiPM to FEB signal correction 11.6 [ns]")
135 Comment(
"window for finding side CRT trigger coincidences [ns]")
139 Comment(
"window for looking data [ns]")
153 vector<pair<CRTHit, vector<int>>>
CreateCRTHits(
vector<art::Ptr<CRTData>> crtList, uint64_t trigger_timestamp);
156 vector<art::Ptr<CRTData>>
PreselectCRTData(
const vector<art::Ptr<CRTData>> &crtList, uint64_t trigger_timestamp);
160 float peshit, uint64_t time0, Long64_t time1,
int plane,
161 double x,
double ex,
double y,
double ey,
double z,
double ez,
string tagger);
197 static bool compareBytime(art::Ptr<CRTData>
const &
a, art::Ptr<CRTData>
const &b){
198 return a->fTs0 < b->fTs0;
210 ULong64_t T0_delay=0;
211 ULong64_t T1_delay=0;
225 FEBs={{271, {81, 198, 271, 283ull, 2000309ull}},
226 {270, {119, 197, 270, 298ull, 2000324ull}},
227 {269, {87, 196, 269, 313ull, 2000339ull}},
228 {268, {92, 195, 268, 329ull, 2000355ull}},
229 {267, {180, 194, 267, 344ull, 2000370ull}},
230 {266, {97, 193, 266, 359ull, 2000385ull}},
231 {265, {174, 192, 265, 374ull, 2000400ull}},
232 {251, {238, 178, 251, 390ull, 2000416ull}},
233 {237, {234, 164, 237, 405ull, 2000431ull}},
234 {297, {189, 224, 297, 420ull, 2000446ull}},
235 {296, {190, 223, 296, 436ull, 2000462ull}},
236 {295, {80, 222, 295, 451ull, 2000477ull}},
237 {294, {162, 221, 294, 466ull, 2000492ull}},
238 {293, {64, 220, 293, 482ull, 2000508ull}},
239 {255, {172, 182, 255, 298ull, 2000324ull}},
240 {254, {114, 181, 254, 313ull, 2000339ull}},
241 {253, {100, 180, 253, 328ull, 2000355ull}},
242 {252, {150, 179, 252, 344ull, 2000370ull}},
243 {238, {176, 165, 238, 359ull, 2000385ull}},
244 {224, {67, 151, 224, 374ull, 2000400ull}},
245 {223, {138, 150, 223, 390ull, 2000416ull}},
246 {209, {170, 136, 209, 405ull, 2000431ull}},
247 {195, {101, 122, 195, 420ull, 2000446ull}},
248 {181, {142, 108, 181, 435ull, 2000462ull}},
249 {279, {139, 206, 279, 451ull, 2000477ull}},
250 {280, {185, 207, 280, 466ull, 2000492ull}},
251 {182, {6, 109, 182, 481ull, 2000508ull}},
252 {196, {177, 123, 196, 497ull, 2000523ull}},
253 {210, {61, 137, 210, 512ull, 2000538ull}},
254 {256, {123, 183, 256, 298ull, 2000325ull}},
255 {242, {116, 169, 242, 314ull, 2000340ull}},
256 {241, {104, 168, 241, 329ull, 2000355ull}},
257 {240, {91, 167, 240, 344ull, 2000371ull}},
258 {239, {88, 166, 239, 360ull, 2000386ull}},
259 {225, {120, 152, 225, 375ull, 2000401ull}},
260 {211, {132, 138, 211, 390ull, 2000417ull}},
261 {197, {95, 124, 197, 405ull, 2000432ull}},
262 {183, {232, 110, 183, 421ull, 2000447ull}},
263 {281, {165, 208, 281, 436ull, 2000463ull}},
264 {282, {148, 209, 282, 451ull, 2000478ull}},
265 {184, {237, 111, 184, 467ull, 2000493ull}},
266 {198, {102, 125, 198, 482ull, 2000508ull}},
267 {212, {94, 139, 212, 497ull, 2000524ull}},
268 {226, {130, 153, 226, 513ull, 2000539ull}},
269 {257, {181, 184, 257, 284ull, 2000310ull}},
270 {243, {124, 170, 243, 299ull, 2000325ull}},
271 {229, {152, 156, 229, 314ull, 2000341ull}},
272 {228, {98, 155, 228, 329ull, 2000356ull}},
273 {227, {173, 154, 227, 345ull, 2000371ull}},
274 {213, {169, 140, 213, 360ull, 2000387ull}},
275 {199, {144, 126, 199, 375ull, 2000402ull}},
276 {185, {239, 112, 185, 391ull, 2000417ull}},
277 {283, {147, 210, 283, 306ull, 2000433ull}},
278 {284, {105, 211, 284, 421ull, 2000448ull}},
279 {186, {231, 114, 186, 437ull, 2000463ull}},
280 {200, {117, 127, 200, 452ull, 2000478ull}},
281 {214, {126, 141, 214, 467ull, 2000494ull}},
282 {215, {90, 142, 215, 482ull, 2000509ull}},
283 {201, {183, 128, 201, 498ull, 2000524ull}},
284 {187, {241, 114, 187, 513ull, 2000540ull}},
285 {285, {113, 212, 285, 528ull, 2000555ull}},
286 {258, {233, 185, 258, 283ull, 2000310ull}},
287 {244, {164, 171, 244, 299ull, 2000325ull}},
288 {230, {161, 157, 230, 314ull, 2000341ull}},
289 {231, {203, 158, 231, 329ull, 2000356ull}},
290 {232, {122, 159, 232, 345ull, 2000371ull}},
291 {218, {2, 145, 218, 360ull, 2000387ull}},
292 {204, {112, 131, 204, 375ull, 2000402ull}},
293 {190, {62, 117, 190, 391ull, 2000417ull}},
294 {288, {133, 215, 288, 406ull, 2000432ull}},
295 {287, {168, 214, 287, 421ull, 2000448ull}},
296 {189, {182, 116, 189, 436ull, 2000463ull}},
297 {203, {107, 130, 203, 452ull, 2000478ull}},
298 {217, {252, 144, 217, 467ull, 2000494ull}},
299 {216, {141, 143, 216, 482ull, 2000509ull}},
300 {202, {160, 129, 202, 498ull, 2000524ull}},
301 {188, {137, 115, 188, 513ull, 2000540ull}},
302 {286, {179, 213, 286, 528ull, 2000555ull}},
303 {259, {66, 186, 259, 298ull, 2000325ull}},
304 {245, {247, 172, 245, 314ull, 2000340ull}},
305 {246, {198, 173, 246, 329ull, 2000356ull}},
306 {247, {243, 174, 247, 344ull, 2000371ull}},
307 {248, {72, 175, 248, 360ull, 2000386ull}},
308 {234, {250, 161, 234, 375ull, 2000401ull}},
309 {220, {249, 147, 220, 390ull, 2000417ull}},
310 {206, {248, 133, 206, 405ull, 2000432ull}},
311 {192, {60, 119, 192, 421ull, 2000447ull}},
312 {290, {145, 217, 290, 436ull, 2000463ull}},
313 {289, {110, 216, 289, 451ull, 2000478ull}},
314 {191, {59, 118, 191, 467ull, 2000493ull}},
315 {205, {202, 132, 205, 482ull, 2000509ull}},
316 {219, {135, 146, 219, 497ull, 2000524ull}},
317 {233, {246, 160, 233, 513ull, 2000539ull}},
318 {260, {253, 187, 260, 342ull, 2000369ull}},
319 {261, {245, 188, 261, 358ull, 2000384ull}},
320 {262, {65, 189, 262, 373ull, 2000400ull}},
321 {263, {57, 190, 263, 388ull, 2000415ull}},
322 {249, {63, 176, 249, 404ull, 2000430ull}},
323 {250, {251, 177, 250, 419ull, 2000445ull}},
324 {236, {70, 163, 236, 434ull, 2000461ull}},
325 {222, {155, 149, 222, 449ull, 2000476ull}},
326 {208, {154, 135, 208, 465ull, 2000491ull}},
327 {194, {85, 121, 194, 480ull, 2000507ull}},
328 {292, {134, 219, 292, 495ull, 2000522ull}},
329 {291, {129, 218, 291, 511ull, 2000537ull}},
330 {193, {115, 120, 193, 526ull, 2000553ull}},
331 {207, {204, 134, 207, 541ull, 2000568ull}},
332 {221, {244, 148, 221, 557ull, 2000583ull}},
333 {235, {82, 162, 235, 572ull, 2000598ull}},
334 {272, {186, 199, 272, 284ull, 2000310ull}},
335 {273, {83, 200, 273, 299ull, 2000326ull}},
336 {274, {254, 201, 274, 314ull, 2000341ull}},
337 {275, {166, 202, 275, 330ull, 2000356ull}},
338 {276, {178, 203, 276, 345ull, 2000371ull}},
339 {277, {136, 204, 277, 360ull, 2000387ull}},
340 {278, {184, 205, 278, 375ull, 2000402ull}},
341 {264, {187, 191, 264, 391ull, 2000417ull}},
342 {304, {240, 231, 304, 406ull, 2000433ull}},
343 {303, {242, 230, 303, 421ull, 2000448ull}},
344 {302, {188, 229, 302, 437ull, 2000463ull}},
345 {301, {58, 228, 301, 452ull, 2000479ull}},
346 {300, {143, 227, 300, 467ull, 2000494ull}},
347 {299, {235, 226, 299, 483ull, 2000509ull}}};
fhicl::Atom< double > topPed
process_name opflash particleana ie ie ie z
double fQSlope
Pedestal slope of SiPMs [ADC/photon].
Functions to help with numbers.
CRTHit FillCRTHit(vector< uint8_t > tfeb_id, map< uint8_t, vector< pair< int, float >>> tpesmap, float peshit, uint64_t time0, Long64_t time1, int plane, double x, double ex, double y, double ey, double z, double ez, string tagger)
double fQPed
Pedestal offset of SiPMs [ADC].
process_name opflash particleana ie x
double ftopPed
Dummy Top CRT Pedestal Value.
Declaration of signal hit object.
bool foutCSVFile
FCL input: Write a CSV File?
double ftopGain
Dummy Top CRT Gain Value.
fhicl::Atom< std::string > CSVFile
This provides an art tool interface definition for tools handle the channel mapping The idea is to be...
fhicl::Atom< bool > Verbose
CRTHitRecoAlg(const fhicl::ParameterSet &pset)
std::string fCSVFile
FCL input: file name for output CSV File.
double fPEThresh
threshold[PE] above which charge amplitudes used in hit reco
bool sortbytime(const pair< int, ULong64_t > &a, const pair< int, ULong64_t > &b)
static bool compareBytime(art::Ptr< CRTData > const &a, art::Ptr< CRTData > const &b)
uint64_t fSiPMtoFEBdelay
SiPM to FEB cable induced delay: 11.6 [ns].
fhicl::Atom< double > QPed
fhicl::Atom< double > PEThresh
vector< art::Ptr< CRTData > > PreselectCRTData(const vector< art::Ptr< CRTData >> &crtList, uint64_t trigger_timestamp)
CRTCommonUtils * fCrtutils
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
std::map< feb_index, FEB_delay > CRT_delay_map
Access the description of detector geometry.
fhicl::Atom< uint64_t > CrtWindow
uint64_t fCoinWindow
Coincidence window used for grouping side CRT triggers [ns].
bool fData
look for only data
object containing MC truth information necessary for making RawDigits and doing back tracking ...
process_name opflash particleana ie ie y
fhicl::Atom< double > QSlope
CRTHit MakeTopHit(art::Ptr< CRTData > data, ULong64_t GlobalTrigger[])
CRT_delay_map LoadFEBMap()
art framework interface to geometry description for auxiliary detectors
geo::GeometryCore const * fGeometryService
const icarusDB::IICARUSChannelMap * fChannelMap
void reconfigure(const Config &config)
Single hit (self trigger) of a CRT board.
fhicl::Atom< double > topGain
BEGIN_PROLOG vertical distance to the surface Name
double fPropDelay
propegation time [ns/cm]
Description of geometry of one entire detector.
fhicl::Atom< bool > outCSVFile
Provides recob::Track data product.
fhicl::Atom< bool > UseReadoutWindow
CRTHitRecoAlg(const Config &config)
bool fUseReadoutWindow
Only reconstruct hits within TPC readout window.
CRTHit MakeBottomHit(art::Ptr< CRTData > data)
fhicl::Atom< uint64_t > SiPMtoFEBdelay
uint64_t fCrtWindow
Looking data window within trigger timestamp [ns].
fhicl::Atom< double > PropDelay
bool IsEmptyHit(CRTHit hit)
CRTHit MakeSideHit(vector< art::Ptr< CRTData >> coinData, ULong64_t GlobalTrigger[])
art framework interface to geometry description
fhicl::Atom< uint64_t > CoinWindow
vector< pair< CRTHit, vector< int > > > CreateCRTHits(vector< art::Ptr< CRTData >> crtList, uint64_t trigger_timestamp)
ULong64_t GetMode(std::vector< std::pair< int, ULong64_t >> vector)