Public Member Functions | Private Member Functions | Private Attributes | List of all members
evd::InfoTransfer Class Reference

#include <InfoTransfer.h>

Inheritance diagram for evd::InfoTransfer:

Public Member Functions

 InfoTransfer (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 
 ~InfoTransfer ()
 
void Rebuild (const art::Event &evt)
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void SetTestFlag (int value)
 
int GetTestFlag ()
 
void SetRunNumber (int value)
 
int GetRunNumber ()
 
void SetSubRunNumber (int value)
 
int GetSubRunNumber ()
 
void SetEvtNumber (int value)
 
int GetEvtNumber ()
 
void SetHitList (unsigned int p, std::vector< art::Ptr< recob::Hit > > hits_to_save)
 
std::vector< art::Ptr< recob::Hit > > GetHitList (unsigned int plane)
 
std::vector< art::Ptr< recob::Hit > > GetSelectedHitList (unsigned int plane)
 
void ClearSelectedHitList (int plane)
 
void SetStartHit (unsigned int p, recob::Hit *starthit)
 
recob::HitGetStartHit (unsigned int plane)
 
void SetEndHit (unsigned int p, recob::Hit *endhit)
 
recob::HitGetEndHit (unsigned int plane)
 
std::vector< double > GetStartHitCoords (unsigned int plane)
 
std::vector< double > GetEndHitCoords (unsigned int plane)
 
void SetStartHitCoords (unsigned int plane, std::vector< double > starthitin)
 
void SetEndHitCoords (unsigned int plane, std::vector< double > endhitin)
 
void SetSeedList (std::vector< util::PxLine > seedlines)
 
std::vector< util::PxLineGetSeedList ()
 
 InfoTransfer (fhicl::ParameterSet const &pset, art::ActivityRegistry &reg)
 
 ~InfoTransfer ()
 
void Rebuild (const art::Event &evt, art::ScheduleContext)
 
void reconfigure (fhicl::ParameterSet const &pset)
 
void SetTestFlag (int value)
 
int GetTestFlag () const
 
void SetRunNumber (int value)
 
int GetRunNumber () const
 
void SetSubRunNumber (int value)
 
int GetSubRunNumber () const
 
void SetEvtNumber (int value)
 
int GetEvtNumber () const
 
void SetHitList (unsigned int p, std::vector< art::Ptr< recob::Hit > > hits_to_save)
 
std::vector< art::Ptr< recob::Hit > > const & GetHitList (unsigned int plane) const
 
std::vector< art::Ptr< recob::Hit > > const & GetSelectedHitList (unsigned int plane) const
 
void ClearSelectedHitList (int plane)
 
void SetStartHit (unsigned int p, recob::Hit *starthit)
 
recob::HitGetStartHit (unsigned int plane) const
 
void SetEndHit (unsigned int p, recob::Hit *endhit)
 
recob::HitGetEndHit (unsigned int plane) const
 
std::vector< double > const & GetStartHitCoords (unsigned int plane) const
 
std::vector< double > const & GetEndHitCoords (unsigned int plane) const
 
void SetStartHitCoords (unsigned int plane, std::vector< double > starthitin)
 
void SetEndHitCoords (unsigned int plane, std::vector< double > endhitin)
 
void SetSeedList (std::vector< util::PxLine > seedlines)
 
std::vector< util::PxLine > const & GetSeedList () const
 

Private Member Functions

void FillStartEndHitCoords (unsigned int plane)
 
void FillStartEndHitCoords (unsigned int plane)
 

Private Attributes

int testflag
 
int fEvt
 
int fRun
 
int fSubRun
 
std::vector< std::vector< art::Ptr< recob::Hit > > > fSelectedHitlist
 the list selected by the GUI (one for each plane) More...
 
std::vector< std::vector< art::Ptr< recob::Hit > > > fRefinedHitlist
 the refined hitlist after rebuild (one for each plane) More...
 
std::vector< art::Ptr< recob::Hit > > fFullHitlist
 the full Hit list from the Hitfinder. More...
 
std::string fHitModuleLabel
 label for geant4 module More...
 
std::vector< recob::Hit * > fStartHit
 The Starthit. More...
 
std::vector< recob::Hit * > fRefStartHit
 The Refined Starthit. More...
 
std::vector< recob::Hit * > fEndHit
 The Starthit. More...
 
std::vector< recob::Hit * > fRefEndHit
 The Refined Starthit. More...
 
std::vector< util::PxLinefSeedList
 
std::vector< std::vector< double > > starthitout
 
std::vector< std::vector< double > > endhitout
 
std::vector< std::vector< double > > refstarthitout
 
std::vector< std::vector< double > > refendhitout
 

Detailed Description

Definition at line 34 of file InfoTransfer.h.

Constructor & Destructor Documentation

evd::InfoTransfer::InfoTransfer ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry reg 
)

Definition at line 30 of file InfoTransfer_service.cc.

32  {
33  this->reconfigure(pset);
34  testflag=-1;
35  fEvt=-1;
36  fRun=-1;
37  fSubRun=-1;
38  reg.sPreProcessEvent.watch(this, &InfoTransfer::Rebuild);
40  unsigned int nplanes = geo->Nplanes();
41 
42  fSelectedHitlist.resize(nplanes);
43  fStartHit.resize(nplanes);
44  fRefStartHit.resize(nplanes);
45  fEndHit.resize(nplanes);
46  fRefEndHit.resize(nplanes);
47  starthitout.resize(nplanes);
48  endhitout.resize(nplanes);
49  refstarthitout.resize(nplanes);
50  refendhitout.resize(nplanes);
51  for(unsigned int i=0;i<nplanes;i++){
52  starthitout[i].resize(2);
53  endhitout[i].resize(2);
54  refstarthitout[i].resize(2);
55  refendhitout[i].resize(2);
56  }
57  // hitlist=NULL;
58  }
std::vector< std::vector< double > > refendhitout
Definition: InfoTransfer.h:140
std::vector< recob::Hit * > fStartHit
The Starthit.
Definition: InfoTransfer.h:128
void Rebuild(const art::Event &evt)
std::vector< recob::Hit * > fRefStartHit
The Refined Starthit.
Definition: InfoTransfer.h:129
std::vector< recob::Hit * > fRefEndHit
The Refined Starthit.
Definition: InfoTransfer.h:132
std::vector< recob::Hit * > fEndHit
The Starthit.
Definition: InfoTransfer.h:131
std::vector< std::vector< double > > starthitout
Definition: InfoTransfer.h:136
GlobalSignal< detail::SignalResponseType::FIFO, void(Event const &, ScheduleContext)> sPreProcessEvent
std::vector< std::vector< double > > endhitout
Definition: InfoTransfer.h:137
std::vector< std::vector< art::Ptr< recob::Hit > > > fSelectedHitlist
the list selected by the GUI (one for each plane)
Definition: InfoTransfer.h:123
void reconfigure(fhicl::ParameterSet const &pset)
LArSoft geometry interface.
Definition: ChannelGeo.h:16
std::vector< std::vector< double > > refstarthitout
Definition: InfoTransfer.h:139
evd::InfoTransfer::~InfoTransfer ( )

Definition at line 61 of file InfoTransfer_service.cc.

62  {
63  }
evd::InfoTransfer::InfoTransfer ( fhicl::ParameterSet const &  pset,
art::ActivityRegistry reg 
)
explicit
evd::InfoTransfer::~InfoTransfer ( )

Member Function Documentation

void evd::InfoTransfer::ClearSelectedHitList ( int  plane)
inline

Definition at line 69 of file InfoTransfer.h.

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  }
std::vector< recob::Hit * > fRefStartHit
The Refined Starthit.
Definition: InfoTransfer.h:129
std::vector< recob::Hit * > fRefEndHit
The Refined Starthit.
Definition: InfoTransfer.h:132
std::vector< std::vector< art::Ptr< recob::Hit > > > fSelectedHitlist
the list selected by the GUI (one for each plane)
Definition: InfoTransfer.h:123
QTextStream & endl(QTextStream &s)
void evd::InfoTransfer::ClearSelectedHitList ( int  plane)
inline

Definition at line 70 of file InfoTransfer.h.

71  {
72  if (fSelectedHitlist.size()==0) {return; std::cout<<"no size"<<std::endl;}
73  fSelectedHitlist[plane].clear();
74  for(unsigned int i=0; i<fRefStartHit.size(); i++){
75  fRefStartHit[i]=NULL;
76  fRefEndHit[i]=NULL;
77  }
78  return;
79  }
std::vector< recob::Hit * > fRefStartHit
The Refined Starthit.
Definition: InfoTransfer.h:129
std::vector< recob::Hit * > fRefEndHit
The Refined Starthit.
Definition: InfoTransfer.h:132
std::vector< std::vector< art::Ptr< recob::Hit > > > fSelectedHitlist
the list selected by the GUI (one for each plane)
Definition: InfoTransfer.h:123
QTextStream & endl(QTextStream &s)
void evd::InfoTransfer::FillStartEndHitCoords ( unsigned int  plane)
private

Definition at line 208 of file InfoTransfer_service.cc.

209  {
210 
212  // std::vector <double> sthitout(2);
213  if(fRefStartHit[plane]){
214  starthitout[plane][1] = fRefStartHit[plane]->PeakTime() ;
215  try{
216  if(fRefStartHit[plane]->WireID().isValid){
217  starthitout[plane][0] = fRefStartHit[plane]->WireID().Wire;
218  }
219  else{
220  starthitout[plane][0]=0;
221  }
222  }
223  catch(cet::exception &e) {
224  mf::LogWarning("GraphCluster") << "caught exception \n"
225  << e;
226  starthitout[plane][0]=0;
227  }
228  }
229  else{
230  starthitout[plane][1]=0.;
231  starthitout[plane][0]=0.;
232  }
233 
234 
235  if(fRefEndHit[plane]){
236  endhitout[plane][1] = fRefEndHit[plane]->PeakTime() ;
237  try{
238  if(fRefEndHit[plane]->WireID().isValid){
239  endhitout[plane][0] = fRefEndHit[plane]->WireID().Wire;
240  }
241  else{
242  endhitout[plane][0]=0;
243  }
244  }
245  catch(cet::exception &e) {
246  mf::LogWarning("GraphCluster") << "caught exception \n"
247  << e;
248  endhitout[plane][0]=0;
249  }
250  }
251  else{
252  endhitout[plane][1]=0.;
253  endhitout[plane][0]=0.;
254  }
255 
256 
257  }
std::vector< recob::Hit * > fRefStartHit
The Refined Starthit.
Definition: InfoTransfer.h:129
const double e
IDparameter< geo::WireID > WireID
Member type of validated geo::WireID parameter.
std::vector< recob::Hit * > fRefEndHit
The Refined Starthit.
Definition: InfoTransfer.h:132
std::vector< std::vector< double > > starthitout
Definition: InfoTransfer.h:136
std::vector< std::vector< double > > endhitout
Definition: InfoTransfer.h:137
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
LArSoft geometry interface.
Definition: ChannelGeo.h:16
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
void evd::InfoTransfer::FillStartEndHitCoords ( unsigned int  plane)
private
recob::Hit* evd::InfoTransfer::GetEndHit ( unsigned int  plane) const
inline

Definition at line 89 of file InfoTransfer.h.

90  { return fRefEndHit[plane]; }
std::vector< recob::Hit * > fRefEndHit
The Refined Starthit.
Definition: InfoTransfer.h:132
recob::Hit* evd::InfoTransfer::GetEndHit ( unsigned int  plane)
inline

Definition at line 90 of file InfoTransfer.h.

91  { return fRefEndHit[plane]; };
std::vector< recob::Hit * > fRefEndHit
The Refined Starthit.
Definition: InfoTransfer.h:132
std::vector< double > evd::InfoTransfer::GetEndHitCoords ( unsigned int  plane)
inline

Definition at line 95 of file InfoTransfer.h.

96  { return refendhitout[plane]; };
std::vector< std::vector< double > > refendhitout
Definition: InfoTransfer.h:140
std::vector< double > const& evd::InfoTransfer::GetEndHitCoords ( unsigned int  plane) const
inline

Definition at line 95 of file InfoTransfer.h.

96  { return refendhitout[plane]; }
std::vector< std::vector< double > > refendhitout
Definition: InfoTransfer.h:140
int evd::InfoTransfer::GetEvtNumber ( ) const
inline

Definition at line 57 of file InfoTransfer.h.

57 { return fEvt; }
int evd::InfoTransfer::GetEvtNumber ( )
inline

Definition at line 58 of file InfoTransfer.h.

58 {return fEvt; };
std::vector< art::Ptr < recob::Hit> > const& evd::InfoTransfer::GetHitList ( unsigned int  plane) const
inline

Definition at line 63 of file InfoTransfer.h.

64  { return fRefinedHitlist[plane]; }
std::vector< std::vector< art::Ptr< recob::Hit > > > fRefinedHitlist
the refined hitlist after rebuild (one for each plane)
Definition: InfoTransfer.h:124
std::vector< art::Ptr < recob::Hit> > evd::InfoTransfer::GetHitList ( unsigned int  plane)
inline

Definition at line 64 of file InfoTransfer.h.

65  { return fRefinedHitlist[plane]; };
std::vector< std::vector< art::Ptr< recob::Hit > > > fRefinedHitlist
the refined hitlist after rebuild (one for each plane)
Definition: InfoTransfer.h:124
int evd::InfoTransfer::GetRunNumber ( ) const
inline

Definition at line 53 of file InfoTransfer.h.

53 { return fRun; }
int evd::InfoTransfer::GetRunNumber ( )
inline

Definition at line 54 of file InfoTransfer.h.

54 {return fRun; };
std::vector< util::PxLine > evd::InfoTransfer::GetSeedList ( )

Definition at line 201 of file InfoTransfer_service.cc.

202  {
203  return fSeedList;
204  }
std::vector< util::PxLine > fSeedList
Definition: InfoTransfer.h:134
std::vector< util::PxLine > const & evd::InfoTransfer::GetSeedList ( ) const

Definition at line 205 of file InfoTransfer_service.cc.

206  {
207  return fSeedList;
208  }
std::vector< util::PxLine > fSeedList
Definition: InfoTransfer.h:134
std::vector< art::Ptr < recob::Hit> > const& evd::InfoTransfer::GetSelectedHitList ( unsigned int  plane) const
inline

Definition at line 66 of file InfoTransfer.h.

67  { return fSelectedHitlist[plane]; }
std::vector< std::vector< art::Ptr< recob::Hit > > > fSelectedHitlist
the list selected by the GUI (one for each plane)
Definition: InfoTransfer.h:123
std::vector< art::Ptr < recob::Hit> > evd::InfoTransfer::GetSelectedHitList ( unsigned int  plane)
inline

Definition at line 67 of file InfoTransfer.h.

68  { return fSelectedHitlist[plane]; };
std::vector< std::vector< art::Ptr< recob::Hit > > > fSelectedHitlist
the list selected by the GUI (one for each plane)
Definition: InfoTransfer.h:123
recob::Hit* evd::InfoTransfer::GetStartHit ( unsigned int  plane) const
inline

Definition at line 83 of file InfoTransfer.h.

84  {return fRefStartHit[plane];}
std::vector< recob::Hit * > fRefStartHit
The Refined Starthit.
Definition: InfoTransfer.h:129
recob::Hit* evd::InfoTransfer::GetStartHit ( unsigned int  plane)
inline

Definition at line 84 of file InfoTransfer.h.

85  {return fRefStartHit[plane];};
std::vector< recob::Hit * > fRefStartHit
The Refined Starthit.
Definition: InfoTransfer.h:129
std::vector< double > const& evd::InfoTransfer::GetStartHitCoords ( unsigned int  plane) const
inline

Definition at line 92 of file InfoTransfer.h.

93  { return refstarthitout[plane]; }
std::vector< std::vector< double > > refstarthitout
Definition: InfoTransfer.h:139
std::vector< double > evd::InfoTransfer::GetStartHitCoords ( unsigned int  plane)
inline

Definition at line 93 of file InfoTransfer.h.

94  { return refstarthitout[plane]; };
std::vector< std::vector< double > > refstarthitout
Definition: InfoTransfer.h:139
int evd::InfoTransfer::GetSubRunNumber ( ) const
inline

Definition at line 55 of file InfoTransfer.h.

55 { return fSubRun; }
int evd::InfoTransfer::GetSubRunNumber ( )
inline

Definition at line 56 of file InfoTransfer.h.

56 {return fSubRun; };
int evd::InfoTransfer::GetTestFlag ( ) const
inline

Definition at line 51 of file InfoTransfer.h.

51 { return testflag; }
int evd::InfoTransfer::GetTestFlag ( )
inline

Definition at line 52 of file InfoTransfer.h.

52 {return testflag; };
void evd::InfoTransfer::Rebuild ( const art::Event evt,
art::ScheduleContext   
)

< the refined hitlist after rebuild

Definition at line 88 of file InfoTransfer_service.cc.

89  {
91  unsigned int nplanes = geo->Nplanes();
92  unsigned int which_call=evdb::NavState::Which();
93  if(which_call!=2){
94  //unless we're reloading we want to clear all the selected and refined hits
95  fRefinedHitlist.resize(nplanes);
96  fSelectedHitlist.resize(nplanes);
97  for(unsigned int j=0; j<nplanes;j++){
98  fRefinedHitlist[j].clear();
99  fSelectedHitlist[j].clear();
100  starthitout[j].clear();
101  endhitout[j].clear();
102  starthitout[j].resize(2);
103  endhitout[j].resize(2);
104  refstarthitout[j].clear();
105  refendhitout[j].clear();
106  refstarthitout[j].resize(2);
107  refendhitout[j].resize(2);
108  }
109  //also clear start and end points
110  fRefStartHit.clear();
111  fRefEndHit.clear();
112  fFullHitlist.clear();
113  }
115 
116  fEvt=evt.id().event();
117  fRun=evt.id().run();
118  fSubRun=evt.id().subRun();
119  evt.getByLabel(fHitModuleLabel, hHandle);
120 
121  if(hHandle.failedToGet()){
122 // mf::LogWarning("InfoTransfer") << "failed to get handle to std::vector<recob::Hit> from "<< fHitModuleLabel;
123  return;
124  }
125 
126  // Clear out anything remaining from previous calls to Rebuild
127 
128  fRefinedHitlist.resize(nplanes);
129 
130  for(unsigned int i=0;i<nplanes;i++){
131  fRefinedHitlist[i].clear(); ///< the refined hitlist after rebuild
132  }
133 
134 
135  fFullHitlist.clear();
136  for(unsigned int i=0; i<fRefStartHit.size(); i++){
137  fRefStartHit[i]=NULL;
138  fRefEndHit[i]=NULL;
139  }
140 
141  /////Store start and end hits in new lists and clear the old ones:
142  for(unsigned int i=0;i<nplanes;i++ )
143  { refstarthitout[i].clear();
144  refendhitout[i].clear();
145  refstarthitout[i].resize(2);
146  refendhitout[i].resize(2);
147 
149  refendhitout[i]=endhitout[i];
150 
151  starthitout[i].clear();
152  endhitout[i].clear();
153  starthitout[i].resize(2);
154  endhitout[i].resize(2);
155  }
156 
157  for(size_t p = 0; p < hHandle->size(); ++p){
158  art::Ptr<recob::Hit> hit(hHandle, p);
159  fFullHitlist.push_back(hit);
160  }
161 
162  // fill the selected Hits into the fRefinedHitList from the fSelectedHitList
163  char buf[200];
164  for(unsigned int j=0; j<nplanes; j++){
165  sprintf(buf," ++++rebuilding with %lu selected hits in plane %u \n", fSelectedHitlist[j].size(),j);
166  WriteMsg(buf);
167  }
168 
169  for(size_t t = 0; t < fFullHitlist.size(); ++t){
170  for(unsigned int ip=0;ip<nplanes;ip++) {
171  for(size_t xx = 0; xx < fSelectedHitlist[ip].size(); ++xx){
172  if(fFullHitlist[t]==fSelectedHitlist[ip][xx]) {
173  fRefinedHitlist[ip].push_back(fFullHitlist[t]);
174  break;
175  }
176  }
177 
178  if(fStartHit[ip] && fFullHitlist[t].get()==fStartHit[ip]){
179  fRefStartHit[ip]=const_cast<recob::Hit *>(fFullHitlist[t].get());
180  }
181 
182  if(fEndHit[ip] && fFullHitlist[t].get()==fEndHit[ip]){
183  fRefEndHit[ip]=const_cast<recob::Hit *>(fFullHitlist[t].get());
184  }
185 
186  }
187  }
188  //for(int ip=0;ip<nplanes;ip++)
189  // FillStartEndHitCoords(ip);
190 
191  fSelectedHitlist.clear();
193 
194  return;
195  }
std::vector< std::vector< art::Ptr< recob::Hit > > > fRefinedHitlist
the refined hitlist after rebuild (one for each plane)
Definition: InfoTransfer.h:124
std::vector< std::vector< double > > refendhitout
Definition: InfoTransfer.h:140
std::vector< art::Ptr< recob::Hit > > fFullHitlist
the full Hit list from the Hitfinder.
Definition: InfoTransfer.h:125
std::vector< recob::Hit * > fStartHit
The Starthit.
Definition: InfoTransfer.h:128
RunNumber_t run() const
Definition: EventID.h:98
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
std::vector< recob::Hit * > fRefStartHit
The Refined Starthit.
Definition: InfoTransfer.h:129
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:633
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
std::vector< recob::Hit * > fRefEndHit
The Refined Starthit.
Definition: InfoTransfer.h:132
std::vector< recob::Hit * > fEndHit
The Starthit.
Definition: InfoTransfer.h:131
p
Definition: test.py:223
std::vector< std::vector< double > > starthitout
Definition: InfoTransfer.h:136
std::string fHitModuleLabel
label for geant4 module
Definition: InfoTransfer.h:126
Detector simulation of raw signals on wires.
std::vector< std::vector< double > > endhitout
Definition: InfoTransfer.h:137
std::vector< std::vector< art::Ptr< recob::Hit > > > fSelectedHitlist
the list selected by the GUI (one for each plane)
Definition: InfoTransfer.h:123
EventNumber_t event() const
Definition: EventID.h:116
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
LArSoft geometry interface.
Definition: ChannelGeo.h:16
std::vector< std::vector< double > > refstarthitout
Definition: InfoTransfer.h:139
SubRunNumber_t subRun() const
Definition: EventID.h:110
EventID id() const
Definition: Event.cc:34
bool failedToGet() const
Definition: Handle.h:198
void evd::InfoTransfer::Rebuild ( const art::Event evt)

< the refined hitlist after rebuild

Definition at line 83 of file InfoTransfer_service.cc.

84  {
86  unsigned int nplanes = geo->Nplanes();
87  unsigned int which_call=evdb::NavState::Which();
88  if(which_call!=2){
89  //unless we're reloading we want to clear all the selected and refined hits
90  fRefinedHitlist.resize(nplanes);
91  fSelectedHitlist.resize(nplanes);
92  for(unsigned int j=0; j<nplanes;j++){
93  fRefinedHitlist[j].clear();
94  fSelectedHitlist[j].clear();
95  starthitout[j].clear();
96  endhitout[j].clear();
97  starthitout[j].resize(2);
98  endhitout[j].resize(2);
99  refstarthitout[j].clear();
100  refendhitout[j].clear();
101  refstarthitout[j].resize(2);
102  refendhitout[j].resize(2);
103  }
104  //also clear start and end points
105  fRefStartHit.clear();
106  fRefEndHit.clear();
107  fFullHitlist.clear();
108  }
109 
110  fEvt=evt.id().event();
111  fRun=evt.id().run();
112  fSubRun=evt.id().subRun();
113 
114  auto hHandle = evt.getHandle< std::vector<recob::Hit> >(fHitModuleLabel);
115 
116  if(!hHandle){
117  mf::LogWarning("InfoTransfer") << "failed to get handle to std::vector<recob::Hit> from "
118  << fHitModuleLabel;
119  return;
120  }
121 
122  // Clear out anything remaining from previous calls to Rebuild
123 
124  fRefinedHitlist.resize(nplanes);
125 
126  for(unsigned int i=0;i<nplanes;i++){
127  fRefinedHitlist[i].clear(); ///< the refined hitlist after rebuild
128  }
129 
130 
131  fFullHitlist.clear();
132  for(unsigned int i=0; i<fRefStartHit.size(); i++){
133  fRefStartHit[i]=NULL;
134  fRefEndHit[i]=NULL;
135  }
136 
137  /////Store start and end hits in new lists and clear the old ones:
138  for(unsigned int i=0;i<nplanes;i++ )
139  { refstarthitout[i].clear();
140  refendhitout[i].clear();
141  refstarthitout[i].resize(2);
142  refendhitout[i].resize(2);
143 
145  refendhitout[i]=endhitout[i];
146 
147  starthitout[i].clear();
148  endhitout[i].clear();
149  starthitout[i].resize(2);
150  endhitout[i].resize(2);
151  }
152 
153  for(size_t p = 0; p < hHandle->size(); ++p){
154  art::Ptr<recob::Hit> hit(hHandle, p);
155  fFullHitlist.push_back(hit);
156  }
157 
158  // fill the selected Hits into the fRefinedHitList from the fSelectedHitList
159  char buf[200];
160  for(unsigned int j=0; j<nplanes; j++){
161  sprintf(buf," ++++rebuilding with %lu selected hits in plane %u \n", fSelectedHitlist[j].size(),j);
162  WriteMsg(buf);
163  }
164 
165  for(size_t t = 0; t < fFullHitlist.size(); ++t){
166  for(unsigned int ip=0;ip<nplanes;ip++) {
167  for(size_t xx = 0; xx < fSelectedHitlist[ip].size(); ++xx){
168  if(fFullHitlist[t]==fSelectedHitlist[ip][xx]) {
169  fRefinedHitlist[ip].push_back(fFullHitlist[t]);
170  break;
171  }
172  }
173 
174  if(fStartHit[ip] && fFullHitlist[t].get()==fStartHit[ip]){
175  fRefStartHit[ip]=const_cast<recob::Hit *>(fFullHitlist[t].get());
176  }
177 
178  if(fEndHit[ip] && fFullHitlist[t].get()==fEndHit[ip]){
179  fRefEndHit[ip]=const_cast<recob::Hit *>(fFullHitlist[t].get());
180  }
181 
182  }
183  }
184  //for(int ip=0;ip<nplanes;ip++)
185  // FillStartEndHitCoords(ip);
186 
187  fSelectedHitlist.clear();
189 
190  return;
191  }
std::vector< std::vector< art::Ptr< recob::Hit > > > fRefinedHitlist
the refined hitlist after rebuild (one for each plane)
Definition: InfoTransfer.h:124
std::vector< std::vector< double > > refendhitout
Definition: InfoTransfer.h:140
Handle< PROD > getHandle(SelectorBase const &) const
Definition: DataViewImpl.h:382
std::vector< art::Ptr< recob::Hit > > fFullHitlist
the full Hit list from the Hitfinder.
Definition: InfoTransfer.h:125
std::vector< recob::Hit * > fStartHit
The Starthit.
Definition: InfoTransfer.h:128
RunNumber_t run() const
Definition: EventID.h:98
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
Definition: StdUtils.h:92
std::vector< recob::Hit * > fRefStartHit
The Refined Starthit.
Definition: InfoTransfer.h:129
std::vector< recob::Hit * > fRefEndHit
The Refined Starthit.
Definition: InfoTransfer.h:132
std::vector< recob::Hit * > fEndHit
The Starthit.
Definition: InfoTransfer.h:131
p
Definition: test.py:223
std::vector< std::vector< double > > starthitout
Definition: InfoTransfer.h:136
std::string fHitModuleLabel
label for geant4 module
Definition: InfoTransfer.h:126
Detector simulation of raw signals on wires.
std::vector< std::vector< double > > endhitout
Definition: InfoTransfer.h:137
std::vector< std::vector< art::Ptr< recob::Hit > > > fSelectedHitlist
the list selected by the GUI (one for each plane)
Definition: InfoTransfer.h:123
MaybeLogger_< ELseverityLevel::ELsev_warning, false > LogWarning
EventNumber_t event() const
Definition: EventID.h:116
2D representation of charge deposited in the TDC/wire plane
Definition: Hit.h:48
LArSoft geometry interface.
Definition: ChannelGeo.h:16
std::vector< std::vector< double > > refstarthitout
Definition: InfoTransfer.h:139
SubRunNumber_t subRun() const
Definition: EventID.h:110
EventID id() const
Definition: Event.cc:34
void evd::InfoTransfer::reconfigure ( fhicl::ParameterSet const &  pset)
void evd::InfoTransfer::reconfigure ( fhicl::ParameterSet const &  pset)

Definition at line 66 of file InfoTransfer_service.cc.

67  {
69  unsigned int nplanes = geo->Nplanes();
70  //clear everything
71  fRefinedHitlist.resize(nplanes);
72  fSelectedHitlist.resize(nplanes);
73  for (unsigned int i=0;i<nplanes;i++){
74  fRefinedHitlist[i].clear();
75  fSelectedHitlist[i].clear();
76  }
77  fHitModuleLabel = pset.get<std::string>("HitModuleLabel", "ffthit");
78  }
std::vector< std::vector< art::Ptr< recob::Hit > > > fRefinedHitlist
the refined hitlist after rebuild (one for each plane)
Definition: InfoTransfer.h:124
std::string string
Definition: nybbler.cc:12
std::string fHitModuleLabel
label for geant4 module
Definition: InfoTransfer.h:126
std::vector< std::vector< art::Ptr< recob::Hit > > > fSelectedHitlist
the list selected by the GUI (one for each plane)
Definition: InfoTransfer.h:123
LArSoft geometry interface.
Definition: ChannelGeo.h:16
void evd::InfoTransfer::SetEndHit ( unsigned int  p,
recob::Hit endhit 
)
inline

Definition at line 86 of file InfoTransfer.h.

87  { fEndHit[p]=endhit; }
std::vector< recob::Hit * > fEndHit
The Starthit.
Definition: InfoTransfer.h:131
p
Definition: test.py:223
void evd::InfoTransfer::SetEndHit ( unsigned int  p,
recob::Hit endhit 
)
inline

Definition at line 87 of file InfoTransfer.h.

88  { fEndHit[p]=endhit; };
std::vector< recob::Hit * > fEndHit
The Starthit.
Definition: InfoTransfer.h:131
p
Definition: test.py:223
void evd::InfoTransfer::SetEndHitCoords ( unsigned int  plane,
std::vector< double >  endhitin 
)
inline

Definition at line 102 of file InfoTransfer.h.

103  { endhitout[plane].clear();
104  endhitout[plane].resize(2);
105  endhitout[plane]=endhitin; };
std::vector< std::vector< double > > endhitout
Definition: InfoTransfer.h:137
void evd::InfoTransfer::SetEndHitCoords ( unsigned int  plane,
std::vector< double >  endhitin 
)
inline

Definition at line 105 of file InfoTransfer.h.

106  {
107  endhitout[plane].clear();
108  endhitout[plane].resize(2);
109  endhitout[plane]=endhitin;
110  }
std::vector< std::vector< double > > endhitout
Definition: InfoTransfer.h:137
void evd::InfoTransfer::SetEvtNumber ( int  value)
inline

Definition at line 56 of file InfoTransfer.h.

void evd::InfoTransfer::SetEvtNumber ( int  value)
inline

Definition at line 57 of file InfoTransfer.h.

void evd::InfoTransfer::SetHitList ( unsigned int  p,
std::vector< art::Ptr< recob::Hit > >  hits_to_save 
)
inline

Definition at line 60 of file InfoTransfer.h.

61  { fSelectedHitlist[p].clear(); fSelectedHitlist[p]=hits_to_save; }
p
Definition: test.py:223
std::vector< std::vector< art::Ptr< recob::Hit > > > fSelectedHitlist
the list selected by the GUI (one for each plane)
Definition: InfoTransfer.h:123
void evd::InfoTransfer::SetHitList ( unsigned int  p,
std::vector< art::Ptr< recob::Hit > >  hits_to_save 
)
inline

Definition at line 61 of file InfoTransfer.h.

62  { fSelectedHitlist[p].clear(); fSelectedHitlist[p]=hits_to_save; };
p
Definition: test.py:223
std::vector< std::vector< art::Ptr< recob::Hit > > > fSelectedHitlist
the list selected by the GUI (one for each plane)
Definition: InfoTransfer.h:123
void evd::InfoTransfer::SetRunNumber ( int  value)
inline

Definition at line 52 of file InfoTransfer.h.

void evd::InfoTransfer::SetRunNumber ( int  value)
inline

Definition at line 53 of file InfoTransfer.h.

void evd::InfoTransfer::SetSeedList ( std::vector< util::PxLine seedlines)

Definition at line 194 of file InfoTransfer_service.cc.

195  {
196  fSeedList=seedlines;
197  }
std::vector< util::PxLine > fSeedList
Definition: InfoTransfer.h:134
void evd::InfoTransfer::SetSeedList ( std::vector< util::PxLine seedlines)
void evd::InfoTransfer::SetStartHit ( unsigned int  p,
recob::Hit starthit 
)
inline

Definition at line 80 of file InfoTransfer.h.

81  { fStartHit[p]=starthit; }
std::vector< recob::Hit * > fStartHit
The Starthit.
Definition: InfoTransfer.h:128
p
Definition: test.py:223
void evd::InfoTransfer::SetStartHit ( unsigned int  p,
recob::Hit starthit 
)
inline

Definition at line 81 of file InfoTransfer.h.

82  { fStartHit[p]=starthit; };
std::vector< recob::Hit * > fStartHit
The Starthit.
Definition: InfoTransfer.h:128
p
Definition: test.py:223
void evd::InfoTransfer::SetStartHitCoords ( unsigned int  plane,
std::vector< double >  starthitin 
)
inline

Definition at line 98 of file InfoTransfer.h.

99  { starthitout[plane].clear();
100  starthitout[plane].resize(2);
101  starthitout[plane]=starthitin; };
std::vector< std::vector< double > > starthitout
Definition: InfoTransfer.h:136
void evd::InfoTransfer::SetStartHitCoords ( unsigned int  plane,
std::vector< double >  starthitin 
)
inline

Definition at line 98 of file InfoTransfer.h.

99  {
100  starthitout[plane].clear();
101  starthitout[plane].resize(2);
102  starthitout[plane]=starthitin;
103  }
std::vector< std::vector< double > > starthitout
Definition: InfoTransfer.h:136
void evd::InfoTransfer::SetSubRunNumber ( int  value)
inline

Definition at line 54 of file InfoTransfer.h.

void evd::InfoTransfer::SetSubRunNumber ( int  value)
inline

Definition at line 55 of file InfoTransfer.h.

void evd::InfoTransfer::SetTestFlag ( int  value)
inline

Definition at line 50 of file InfoTransfer.h.

void evd::InfoTransfer::SetTestFlag ( int  value)
inline

Definition at line 51 of file InfoTransfer.h.

Member Data Documentation

std::vector< std::vector< double > > evd::InfoTransfer::endhitout
private

Definition at line 137 of file InfoTransfer.h.

std::vector< recob::Hit * > evd::InfoTransfer::fEndHit
private

The Starthit.

Definition at line 131 of file InfoTransfer.h.

int evd::InfoTransfer::fEvt
private

Definition at line 120 of file InfoTransfer.h.

std::vector< art::Ptr< recob::Hit > > evd::InfoTransfer::fFullHitlist
private

the full Hit list from the Hitfinder.

Definition at line 125 of file InfoTransfer.h.

std::string evd::InfoTransfer::fHitModuleLabel
private

label for geant4 module

Definition at line 126 of file InfoTransfer.h.

std::vector< recob::Hit * > evd::InfoTransfer::fRefEndHit
private

The Refined Starthit.

Definition at line 132 of file InfoTransfer.h.

std::vector< std::vector< art::Ptr< recob::Hit > > > evd::InfoTransfer::fRefinedHitlist
private

the refined hitlist after rebuild (one for each plane)

Definition at line 124 of file InfoTransfer.h.

std::vector< recob::Hit * > evd::InfoTransfer::fRefStartHit
private

The Refined Starthit.

Definition at line 129 of file InfoTransfer.h.

int evd::InfoTransfer::fRun
private

Definition at line 121 of file InfoTransfer.h.

std::vector< util::PxLine > evd::InfoTransfer::fSeedList
private

Definition at line 134 of file InfoTransfer.h.

std::vector< std::vector< art::Ptr< recob::Hit > > > evd::InfoTransfer::fSelectedHitlist
private

the list selected by the GUI (one for each plane)

Definition at line 123 of file InfoTransfer.h.

std::vector< recob::Hit * > evd::InfoTransfer::fStartHit
private

The Starthit.

Definition at line 128 of file InfoTransfer.h.

int evd::InfoTransfer::fSubRun
private

Definition at line 122 of file InfoTransfer.h.

std::vector< std::vector< double > > evd::InfoTransfer::refendhitout
private

Definition at line 140 of file InfoTransfer.h.

std::vector< std::vector< double > > evd::InfoTransfer::refstarthitout
private

Definition at line 139 of file InfoTransfer.h.

std::vector< std::vector< double > > evd::InfoTransfer::starthitout
private

Definition at line 136 of file InfoTransfer.h.

int evd::InfoTransfer::testflag
private

Definition at line 119 of file InfoTransfer.h.


The documentation for this class was generated from the following files: