LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
InfoTransfer.h
Go to the documentation of this file.
1 //
3 // Transfer hitlist and run info into a producer module.
4 // Do not copy this code without contacting Andrzej Szelc and Brian Rebel first.
5 //
6 // \author andrzej.szelc@yale.edu
7 // \author ellen.klein@yale.edu
9 #ifndef INFOTRANSFER_H
10 #define INFOTRANSFER_H
11 #ifndef __CINT__
12 #include <string>
13 #include <vector>
14 #include <iostream>
15 
16 #include "fhiclcpp/ParameterSet.h"
21 
24 
25 
26  namespace util {
27  class PxPoint;
28  class PxLine;
29  }
30 
31 
32 namespace evd {
34  {
35  public:
36  explicit InfoTransfer(fhicl::ParameterSet const& pset, art::ActivityRegistry& reg);
37  ~InfoTransfer();
38 
39 
40  // The Rebuild function rebuilds the various maps we need to pickup hits.
41  // It is called automatically before each event is processed. For jobs involving
42  // Monte Carlo generation, this is too soon. So, we'll call rebuild after those data
43  // products are put into the event in LArG4. This is the least bad way of ensuring the
44  // InfoTransfer works in jobs that combine MC production and reconstruction analysis based
45  // on MC truth. Don't copy this design pattern without talking to brebel@fnal.gov first
46  void Rebuild(const art::Event& evt);
47 
48 
49  void reconfigure(fhicl::ParameterSet const& pset) ;
50  void SetTestFlag(int value){ testflag = value; };
51  int GetTestFlag(){return testflag; };
52  void SetRunNumber(int value){ fRun = value; };
53  int GetRunNumber(){return fRun; };
54  void SetSubRunNumber(int value){ fSubRun = value; };
55  int GetSubRunNumber(){return fSubRun; };
56  void SetEvtNumber(int value){ fEvt = value; };
57  int GetEvtNumber(){return fEvt; };
58 
59 
60  void SetHitList(unsigned int p,std::vector<art::Ptr < recob::Hit> > hits_to_save)
61  { fSelectedHitlist[p].clear(); fSelectedHitlist[p]=hits_to_save; };
62 
63  std::vector < art::Ptr < recob::Hit> > GetHitList(unsigned int plane)
64  { return fRefinedHitlist[plane]; };
65 
66  std::vector< art::Ptr < recob::Hit> > GetSelectedHitList(unsigned int plane)
67  { return fSelectedHitlist[plane]; };
68 
69  void ClearSelectedHitList(int plane)
70  {
71  if (fSelectedHitlist.size()==0) {return; std::cout<<"no size"<<std::endl;}
72  fSelectedHitlist[plane].clear();
73  for(unsigned int i=0; i<fRefStartHit.size(); i++){
74  fRefStartHit[i]=NULL;
75  fRefEndHit[i]=NULL;
76  }
77  return;
78  }
79 
80  void SetStartHit(unsigned int p, recob::Hit * starthit)
81  { fStartHit[p]=starthit; };
82 
83  recob::Hit * GetStartHit(unsigned int plane)
84  {return fRefStartHit[plane];};
85 
86  void SetEndHit(unsigned int p, recob::Hit * endhit)
87  { fEndHit[p]=endhit; };
88 
89  recob::Hit * GetEndHit(unsigned int plane)
90  { return fRefEndHit[plane]; };
91 
92  std::vector< double > GetStartHitCoords(unsigned int plane)
93  { return refstarthitout[plane]; };
94  std::vector< double > GetEndHitCoords(unsigned int plane)
95  { return refendhitout[plane]; };
96 
97  void SetStartHitCoords(unsigned int plane, std::vector< double > starthitin)
98  { starthitout[plane].clear();
99  starthitout[plane].resize(2);
100  starthitout[plane]=starthitin; };
101  void SetEndHitCoords(unsigned int plane, std::vector< double > endhitin)
102  { endhitout[plane].clear();
103  endhitout[plane].resize(2);
104  endhitout[plane]=endhitin; };
105 
106 
107  void SetSeedList(std::vector < util::PxLine > seedlines);
108 
109 
110  std::vector < util::PxLine > GetSeedList();
111 
112 
113 
114  private:
115 
116  void FillStartEndHitCoords(unsigned int plane);
117 
118  int testflag;
119  int fEvt;
120  int fRun;
121  int fSubRun;
122  std::vector < std::vector< art::Ptr < recob::Hit > > > fSelectedHitlist;
123  std::vector < std::vector< art::Ptr < recob::Hit > > > fRefinedHitlist;
124  std::vector< art::Ptr < recob::Hit > > fFullHitlist;
125  std::string fHitModuleLabel;
126 
127  std::vector < recob::Hit * > fStartHit;
128  std::vector < recob::Hit * > fRefStartHit;
129 
130  std::vector < recob::Hit * > fEndHit;
131  std::vector < recob::Hit * > fRefEndHit;
132 
133  std::vector < util::PxLine > fSeedList;
134 
135  std::vector < std::vector <double > > starthitout;
136  std::vector < std::vector <double > > endhitout;
137 
138  std::vector < std::vector <double > > refstarthitout;
139  std::vector < std::vector <double > > refendhitout;
140 
141  };
142 }//namespace
143 #endif // __CINT__
145 #endif
146 
void SetTestFlag(int value)
Definition: InfoTransfer.h:50
std::vector< double > GetStartHitCoords(unsigned int plane)
Definition: InfoTransfer.h:92
Namespace for general, non-LArSoft-specific utilities.
Definition: PIDAAlg.h:17
void SetStartHit(unsigned int p, recob::Hit *starthit)
Definition: InfoTransfer.h:80
void SetEndHit(unsigned int p, recob::Hit *endhit)
Definition: InfoTransfer.h:86
void ClearSelectedHitList(int plane)
Definition: InfoTransfer.h:69
Declaration of signal hit object.
std::vector< std::vector< double > > endhitout
Definition: InfoTransfer.h:136
#define DECLARE_ART_SERVICE(svc, scope)
Definition: ServiceMacros.h:91
recob::Hit * GetStartHit(unsigned int plane)
Definition: InfoTransfer.h:83
void SetStartHitCoords(unsigned int plane, std::vector< double > starthitin)
Definition: InfoTransfer.h:97
std::vector< recob::Hit * > fStartHit
The Starthit.
Definition: InfoTransfer.h:127
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Definition: DumpUtils.h:265
std::vector< recob::Hit * > fRefStartHit
The Refined Starthit.
Definition: InfoTransfer.h:128
void SetRunNumber(int value)
Definition: InfoTransfer.h:52
std::vector< std::vector< double > > refstarthitout
Definition: InfoTransfer.h:138
LArSoft includes.
void SetSubRunNumber(int value)
Definition: InfoTransfer.h:54
std::vector< double > GetEndHitCoords(unsigned int plane)
Definition: InfoTransfer.h:94
void SetHitList(unsigned int p, std::vector< art::Ptr< recob::Hit > > hits_to_save)
Definition: InfoTransfer.h:60
std::vector< recob::Hit * > fRefEndHit
The Refined Starthit.
Definition: InfoTransfer.h:131
recob::Hit * GetEndHit(unsigned int plane)
Definition: InfoTransfer.h:89
std::vector< recob::Hit * > fEndHit
The Starthit.
Definition: InfoTransfer.h:130
std::vector< std::vector< art::Ptr< recob::Hit > > > fRefinedHitlist
the refined hitlist after rebuild (one for each plane)
Definition: InfoTransfer.h:123
Interface class to services that are intended to be reconfigurable through the event display...
std::string fHitModuleLabel
label for geant4 module
Definition: InfoTransfer.h:125
Declaration of cluster object.
std::vector< std::vector< double > > starthitout
Definition: InfoTransfer.h:135
std::vector< art::Ptr< recob::Hit > > fFullHitlist
the full Hit list from the Hitfinder.
Definition: InfoTransfer.h:124
void SetEvtNumber(int value)
Definition: InfoTransfer.h:56
std::vector< art::Ptr< recob::Hit > > GetSelectedHitList(unsigned int plane)
Definition: InfoTransfer.h:66
std::vector< std::vector< art::Ptr< recob::Hit > > > fSelectedHitlist
the list selected by the GUI (one for each plane)
Definition: InfoTransfer.h:122
std::string value(boost::any const &)
std::vector< std::vector< double > > refendhitout
Definition: InfoTransfer.h:139
void SetEndHitCoords(unsigned int plane, std::vector< double > endhitin)
Definition: InfoTransfer.h:101
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:49
TCEvent evt
Definition: DataStructs.cxx:5
std::vector< util::PxLine > fSeedList
Definition: InfoTransfer.h:133
std::vector< art::Ptr< recob::Hit > > GetHitList(unsigned int plane)
Definition: InfoTransfer.h:63