LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
CosmicTag.cxx
Go to the documentation of this file.
1 //
3 // \brief Definition of CosmicTag analysis object
4 //
5 // \author lockwitz@fnal.gov
7 
9 
10 #include <iomanip>
11 #include <iostream>
12 
13 namespace anab {
14 
15  //----------------------------------------------------------------------
17  : endPt1(0), endPt2(0), fCosmicScore(0), fCosmicType(CosmicTagID_t::kUnknown)
18  {}
19 
20  //----------------------------------------------------------------------
23  {}
24 
25  //----------------------------------------------------------------------
26  CosmicTag::CosmicTag(std::vector<float> ePt1,
27  std::vector<float> ePt2,
28  // double flashTime, // should go
29  float cScore,
30  CosmicTagID_t cType)
31  : endPt1(ePt1), endPt2(ePt2), fCosmicScore(cScore), fCosmicType(cType)
32  {}
33 
34  //----------------------------------------------------------------------
35  // ostream operator.
36  //
37  std::ostream& operator<<(std::ostream& o, CosmicTag const& a)
38  {
39  o //<< "Flash Time : " << a.flashTime // should go
40  << "\n Cosmic Score : " << a.fCosmicScore << "\n Cosmic Type : " << a.fCosmicType
41  << "\n End Point 1: " << std::endl;
42  for (size_t i = 0; i < a.endPt1.size(); i++)
43  o << a.endPt1[i] << ", ";
44  o << std::endl;
45  o << "\n End Point 2: " << std::endl;
46  for (size_t i = 0; i < a.endPt2.size(); i++)
47  o << a.endPt2[i] << ", ";
48  o << std::endl;
49 
50  return o;
51  }
52 
54  float xDrift,
55  int tSample,
56  float realTime,
57  int tick) const
58  {
59  // fix this
60  int t = 3 * tSample;
61  if ((tick > 0 * tSample) && (tick < 1 * tSample)) t = 0 * tSample;
62  if ((tick > 1 * tSample) && (tick < 2 * tSample)) t = 1 * tSample;
63  if ((tick > 2 * tSample) && (tick < 3 * tSample)) t = 2 * tSample;
64 
65  float newX = oldX + (xDrift / tSample) * (t - realTime);
66  return newX;
67  }
68 
69 }
friend std::ostream & operator<<(std::ostream &o, CosmicTag const &a)
Definition: CosmicTag.cxx:37
enum anab::cosmic_tag_id CosmicTagID_t
for(Int_t i=0;i< nentries;i++)
Definition: comparison.C:30
TFile f
Definition: plotHisto.C:6
std::vector< float > endPt1
Definition: CosmicTag.h:41
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
Definition: electronics.h:73
std::vector< float > endPt2
Definition: CosmicTag.h:42
Int_t oldX
float getXInteraction(float oldX, float xDrift, int tSample, float realTime, int tick) const
Definition: CosmicTag.cxx:53
float fCosmicScore
Definition: CosmicTag.h:43
CosmicTagID_t fCosmicType
Definition: CosmicTag.h:46