LArSoft  v07_13_02
Liquid Argon Software toolkit - http://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 
10 
11 namespace anab{
12 
13  //----------------------------------------------------------------------
15  : endPt1(0)
16  , endPt2(0)
17  , fCosmicScore(0)
18  , fCosmicType(CosmicTagID_t::kUnknown)
19  {
20  }
21 
22  //----------------------------------------------------------------------
24  endPt1(0),
25  endPt2(0),
26  fCosmicScore(f),
28  {
29 
30  }
31 
32  //----------------------------------------------------------------------
33  CosmicTag::CosmicTag(std::vector<float> ePt1,
34  std::vector<float> ePt2,
35  // double flashTime, // should go
36  float cScore,
37  CosmicTagID_t cType) :
38  endPt1(ePt1),
39  endPt2(ePt2),
40  fCosmicScore(cScore),
41  fCosmicType(cType)
42  {
43  }
44 
45 
46 
47  //----------------------------------------------------------------------
48  // ostream operator.
49  //
50  std::ostream& operator<< (std::ostream & o, CosmicTag const& a)
51  {
52  o //<< "Flash Time : " << a.flashTime // should go
53  << "\n Cosmic Score : " << a.fCosmicScore
54  << "\n Cosmic Type : " << a.fCosmicType
55  << "\n End Point 1: " <<std::endl;
56  for(size_t i=0;i<a.endPt1.size(); i++)
57  o << a.endPt1[i] << ", ";
58  o << std::endl;
59  o << "\n End Point 2: " <<std::endl;
60  for(size_t i=0;i<a.endPt2.size(); i++)
61  o << a.endPt2[i] << ", ";
62  o << std::endl;
63 
64 
65  return o;
66  }
67 
68  float CosmicTag::getXInteraction(float oldX, float xDrift, int tSample,
69  float realTime, int tick ) const {
70  // fix this
71  int t =3*tSample;
72  if( (tick > 0*tSample) && (tick < 1*tSample) ) t = 0*tSample;
73  if( (tick > 1*tSample) && (tick < 2*tSample) ) t = 1*tSample;
74  if( (tick > 2*tSample) && (tick < 3*tSample) ) t = 2*tSample;
75 
76  float newX = oldX + (xDrift/tSample)*(t - realTime);
77  return newX;
78  }
79 
80 
81 }
friend std::ostream & operator<<(std::ostream &o, CosmicTag const &a)
Definition: CosmicTag.cxx:50
enum anab::cosmic_tag_id CosmicTagID_t
TFile f
Definition: plotHisto.C:6
std::vector< float > endPt1
Definition: CosmicTag.h:47
std::vector< float > endPt2
Definition: CosmicTag.h:48
Int_t oldX
float getXInteraction(float oldX, float xDrift, int tSample, float realTime, int tick) const
Definition: CosmicTag.cxx:68
float fCosmicScore
Definition: CosmicTag.h:49
CosmicTagID_t fCosmicType
Definition: CosmicTag.h:52