Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
beamlinereco::WCTrackReco Class Reference
Inheritance diagram for beamlinereco::WCTrackReco:
art::EDProducer art::ProducerBase art::Consumer art::EngineCreator art::ProductRegistryHelper

Public Types

using ModuleType = EDProducer
 
using WorkerType = WorkerT< EDProducer >
 
template<typename UserConfig , typename KeysToIgnore = void>
using Table = ProducerBase::Table< UserConfig, KeysToIgnore >
 

Public Member Functions

 WCTrackReco (const fhicl::ParameterSet &pset)
 
void reconfigure (const fhicl::ParameterSet &pset)
 
void beginJob ()
 
void produce (art::Event &evt)
 
template<typename PROD , BranchType B = InEvent>
ProductID getProductID (std::string const &instanceName={}) const
 
template<typename PROD , BranchType B>
ProductID getProductID (ModuleDescription const &moduleDescription, std::string const &instanceName) const
 
bool modifiesEvent () const
 
template<typename T , BranchType = InEvent>
ProductToken< Tconsumes (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< Tconsumes (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void consumesMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > consumesView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TconsumesView (InputTag const &it)
 
template<typename T , BranchType = InEvent>
ProductToken< TmayConsume (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ProductToken< TmayConsume (InputTag const &it)
 
template<typename T , BranchType = InEvent>
void mayConsumeMany ()
 
template<typename Element , BranchType = InEvent>
ViewToken< Element > mayConsumeView (InputTag const &)
 
template<typename T , art::BranchType BT>
art::ViewToken< TmayConsumeView (InputTag const &it)
 
base_engine_tcreateEngine (seed_t seed)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make)
 
base_engine_tcreateEngine (seed_t seed, std::string const &kind_of_engine_to_make, label_t const &engine_label)
 
seed_t get_seed_value (fhicl::ParameterSet const &pset, char const key[]="seed", seed_t const implicit_seed=-1)
 

Static Public Member Functions

static cet::exempt_ptr< Consumernon_module_context ()
 

Protected Member Functions

CurrentProcessingContext const * currentContext () const
 
void validateConsumedProduct (BranchType const bt, ProductInfo const &pi)
 
void prepareForJob (fhicl::ParameterSet const &pset)
 
void showMissingConsumes () const
 

Private Attributes

art::InputTag fRawWCDataLabel
 
art::InputTag fRawBeamlineConfigLabel
 
art::InputTag fMCenterDataLabel
 
bool fVerbose
 
bool fPickyTracks
 
bool fUseIFDB
 
double fVertexTime
 
TH1F * fReco_P
 
TH1F * fY_Kink
 
TH1F * fX_Dist
 
TH1F * fY_Dist
 
TH1F * fZ_Dist
 
TH1F * fX_Mag_Int
 
TH1F * fY_Mag_Int
 
TH1F * fZ_Mag_Int
 
TH1F * fDist_to_Mag_Axis
 
TH1F * fX_Face_Dist
 
TH1F * fY_Face_Dist
 
TH1F * fTheta_Dist
 
TH1F * fPhi_Dist
 
TH1F * fTrack_Type
 
TH1F * fWCDist
 
WCHitFinderAlg fWCHitFinderAlg
 
WCTrackAlg fWCTrackAlg
 
art::ServiceHandle< beamlineutil::BeamlineMagneticFieldfMagneticField
 

Detailed Description

Definition at line 43 of file WCTrackReco_module.cc.

Member Typedef Documentation

using art::EDProducer::ModuleType = EDProducer
inherited

Definition at line 34 of file EDProducer.h.

template<typename UserConfig , typename KeysToIgnore = void>
using art::EDProducer::Table = ProducerBase::Table<UserConfig, KeysToIgnore>
inherited

Definition at line 43 of file EDProducer.h.

using art::EDProducer::WorkerType = WorkerT<EDProducer>
inherited

Definition at line 35 of file EDProducer.h.

Constructor & Destructor Documentation

beamlinereco::WCTrackReco::WCTrackReco ( const fhicl::ParameterSet pset)
explicit

Definition at line 95 of file WCTrackReco_module.cc.

References reconfigure().

95  :
96  fWCHitFinderAlg(pset.get<fhicl::ParameterSet>("WCHitFinderAlg")),
97  fWCTrackAlg(pset.get<fhicl::ParameterSet>("WCTrackAlg")) {
98 
99  this->reconfigure(pset);
100  produces<std::vector<brb::WCTrack> >();
101  produces<art::Assns<brb::WCTrack, rawdata::RawBeamlineWC> >();
102  produces<std::vector<rb::Vertex> > ();
103  produces<art::Assns<rb::Vertex, brb::WCTrack> > ();
104 }
void reconfigure(const fhicl::ParameterSet &pset)
T get(std::string const &key) const
Definition: ParameterSet.h:231

Member Function Documentation

void beamlinereco::WCTrackReco::beginJob ( )
virtual

Reimplemented from art::EDProducer.

Definition at line 117 of file WCTrackReco_module.cc.

References fDist_to_Mag_Axis, fPhi_Dist, fReco_P, fTheta_Dist, fTrack_Type, fWCDist, fX_Dist, fX_Face_Dist, fX_Mag_Int, fY_Dist, fY_Face_Dist, fY_Kink, fY_Mag_Int, fZ_Dist, fZ_Mag_Int, and art::TFileDirectory::make().

117  {
119 
120  fWCDist = tfs->make<TH1F>("WCCond","WC Conditions",7,0,7);
121  fReco_P = tfs->make<TH1F>("Reco_P","Reconstructed momentum", 180, 0, 1800);
122  fY_Kink = tfs->make<TH1F>("Y_Kink","Angle between US/DS tracks in Y direction (degrees)",200,-10*3.1415926/180,10*3.141592654/180);
123  fX_Dist = tfs->make<TH1F>("X_Dist","X distance between US/DS tracks at midplane (mm)",1200,-60,1260); //Do not trust these values
124  fY_Dist = tfs->make<TH1F>("Y_Dist","Y distance between US/DS tracks at midplane (mm)",1200,-600,600); //Do not trust these values
125  fZ_Dist = tfs->make<TH1F>("Z_Dist","Z distance between US/DS tracks at midplane (mm)",1200,-60,1260); //Do not trust these values
126  fX_Mag_Int = tfs->make<TH1F>("X_Mag_Int","X intercept of WC track with magnet front face (cm)",100,-150,-100);
127  fX_Mag_Int->GetXaxis()->SetTitle("X intercept [cm]");
128  fX_Mag_Int->GetYaxis()->SetTitle("Tracks per 2 cm");
129  fY_Mag_Int = tfs->make<TH1F>("Y_Mag_Int","Y intercept of WC track with magnet front face (cm)",100,-10,10);
130  fY_Mag_Int->GetXaxis()->SetTitle("Y intercept [cm]");
131  fY_Mag_Int->GetYaxis()->SetTitle("Tracks per 0.22 cm");
132  fZ_Mag_Int = tfs->make<TH1F>("Z_Mag_Int","Z intercept of WC track with magnet front face (cm)",100,415,425);
133  fZ_Mag_Int->GetXaxis()->SetTitle("Z intercept [cm]");
134  fZ_Mag_Int->GetYaxis()->SetTitle("Tracks per 0.1 cm");
135  fDist_to_Mag_Axis = tfs->make<TH1F>("Dist_to_Mag_Axis","Transverse distance to central axis of magnet [cm]",80,-20,20);
136  fDist_to_Mag_Axis->GetXaxis()->SetTitle("Transverse distance from WC track to central axis of magnet [cm]");
137  fDist_to_Mag_Axis->GetXaxis()->SetTitle("Tracks per 0.5 cm");
138  fX_Face_Dist = tfs->make<TH1F>("X_Face","X Location of Track's Detector Entry (mm)",1600,-200,1400);
139  fY_Face_Dist = tfs->make<TH1F>("Y_Face","Y Location of Track's Detector Entry (mm)",800,-400,400);
140  fTheta_Dist = tfs->make<TH1F>("Theta","Track Theta (w.r.t. Detector Z axis), (radians),",400,-.4,0.4);
141  fPhi_Dist = tfs->make<TH1F>("Phi","Track Phi (w.r.t. Detector X axis), (radians)",2000,-6.28318,6.28318);
142  fReco_P->GetXaxis()->SetTitle("Reconstructed momentum (MeV/c)");
143  fReco_P->GetYaxis()->SetTitle("Tracks per 10 MeV/c");
144  fY_Kink->GetXaxis()->SetTitle("Reconstructed y_kink (radians)");
145  fY_Kink->GetYaxis()->SetTitle("Tracks per 0.000872 radians");
146  fX_Dist->GetXaxis()->SetTitle("X distance between US and DS track ends");
147  fX_Dist->GetYaxis()->SetTitle("Tracks per 1 mm - DO NOT TRUST THESE VALUES");
148  fY_Dist->GetXaxis()->SetTitle("Y distance between US and DS track ends");
149  fY_Dist->GetYaxis()->SetTitle("Tracks per 1 mm - DO NOT TRUST THESE VALUES");
150  fZ_Dist->GetXaxis()->SetTitle("Z distance between US and DS track ends");
151  fZ_Dist->GetYaxis()->SetTitle("Tracks per 1 mm - DO NOT TRUST THESE VALUES");
152  fX_Face_Dist->GetXaxis()->SetTitle("X (mm)");
153  fX_Face_Dist->GetYaxis()->SetTitle("Tracks per 1 mm");
154  fY_Face_Dist->GetXaxis()->SetTitle("Y (mm)");
155  fY_Face_Dist->GetYaxis()->SetTitle("Tracks per 1 mm");
156  fTheta_Dist->GetXaxis()->SetTitle("Theta (radians)");
157  fTheta_Dist->GetYaxis()->SetTitle("Tracks per .002 radians");
158  fPhi_Dist->GetXaxis()->SetTitle("Phi (radians)");
159  fPhi_Dist->GetYaxis()->SetTitle("Tracks per 0.00628 radians");
160  fTrack_Type = tfs->make<TH1F>("TrackType","WCTrack conditions: 1=missHit,2=uniqueHits,3=lonelyHit,4=socialHits",4,0,4);
161  fTrack_Type->GetYaxis()->SetTitle("# Events");
162  fTrack_Type->GetXaxis()->SetTitle("Track Conditions");
163 
164 }
T * make(ARGS...args) const
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::consumes ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::consumes ( InputTag const &  it)
inherited

Definition at line 146 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

147 {
148  if (!moduleContext_)
149  return ProductToken<T>::invalid();
150 
151  consumables_[BT].emplace_back(ConsumableType::Product,
152  TypeID{typeid(T)},
153  it.label(),
154  it.instance(),
155  it.process());
156  return ProductToken<T>{it};
157 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::consumesMany ( )
inherited

Definition at line 161 of file Consumer.h.

References T.

162 {
163  if (!moduleContext_)
164  return;
165 
166  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
167 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::consumesView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::consumesView ( InputTag const &  it)
inherited

Definition at line 171 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

172 {
173  if (!moduleContext_)
174  return ViewToken<T>::invalid();
175 
176  consumables_[BT].emplace_back(ConsumableType::ViewElement,
177  TypeID{typeid(T)},
178  it.label(),
179  it.instance(),
180  it.process());
181  return ViewToken<T>{it};
182 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make 
)
inherited
base_engine_t& art::EngineCreator::createEngine ( seed_t  seed,
std::string const &  kind_of_engine_to_make,
label_t const &  engine_label 
)
inherited
CurrentProcessingContext const* art::EDProducer::currentContext ( ) const
protectedinherited
seed_t art::EngineCreator::get_seed_value ( fhicl::ParameterSet const &  pset,
char const  key[] = "seed",
seed_t const  implicit_seed = -1 
)
inherited
template<typename PROD , BranchType B>
ProductID art::EDProducer::getProductID ( std::string const &  instanceName = {}) const
inlineinherited

Definition at line 123 of file EDProducer.h.

References art::EDProducer::moduleDescription_.

Referenced by skim::NueSkimmer::CopyMichelSlice(), and skim::NueSkimmer::CopyMichelTrack().

124  {
125  return ProducerBase::getProductID<PROD, B>(moduleDescription_,
126  instanceName);
127  }
ModuleDescription moduleDescription_
Definition: EDProducer.h:115
template<typename PROD , BranchType B>
ProductID art::ProducerBase::getProductID ( ModuleDescription const &  moduleDescription,
std::string const &  instanceName 
) const
inherited

Definition at line 56 of file ProducerBase.h.

References art::ModuleDescription::moduleLabel().

Referenced by art::ProducerBase::modifiesEvent().

58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
template<typename T , BranchType = InEvent>
ProductToken<T> art::Consumer::mayConsume ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ProductToken<T> art::Consumer::mayConsume ( InputTag const &  it)
inherited

Definition at line 189 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

190 {
191  if (!moduleContext_)
192  return ProductToken<T>::invalid();
193 
194  consumables_[BT].emplace_back(ConsumableType::Product,
195  TypeID{typeid(T)},
196  it.label(),
197  it.instance(),
198  it.process());
199  return ProductToken<T>{it};
200 }
set< int >::iterator it
static ProductToken< T > invalid()
Definition: ProductToken.h:47
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename T , art::BranchType BT>
void art::Consumer::mayConsumeMany ( )
inherited

Definition at line 204 of file Consumer.h.

References T.

205 {
206  if (!moduleContext_)
207  return;
208 
209  consumables_[BT].emplace_back(ConsumableType::Many, TypeID{typeid(T)});
210 }
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
template<typename Element , BranchType = InEvent>
ViewToken<Element> art::Consumer::mayConsumeView ( InputTag const &  )
inherited
template<typename T , art::BranchType BT>
art::ViewToken<T> art::Consumer::mayConsumeView ( InputTag const &  it)
inherited

Definition at line 214 of file Consumer.h.

References art::InputTag::instance(), PandAna.reco_validation.prod5_pid_validation::invalid, art::InputTag::label(), art::InputTag::process(), and T.

215 {
216  if (!moduleContext_)
217  return ViewToken<T>::invalid();
218 
219  consumables_[BT].emplace_back(ConsumableType::ViewElement,
220  TypeID{typeid(T)},
221  it.label(),
222  it.instance(),
223  it.process());
224  return ViewToken<T>{it};
225 }
set< int >::iterator it
static ViewToken< Element > invalid()
Definition: ProductToken.h:75
ConsumableProducts consumables_
Definition: Consumer.h:137
double T
Definition: Xdiff_gwt.C:5
bool moduleContext_
Definition: Consumer.h:135
bool art::ProducerBase::modifiesEvent ( ) const
inlineinherited

Definition at line 40 of file ProducerBase.h.

References art::ProducerBase::getProductID(), and string.

41  {
42  return true;
43  }
static cet::exempt_ptr<Consumer> art::Consumer::non_module_context ( )
staticinherited
void art::Consumer::prepareForJob ( fhicl::ParameterSet const &  pset)
protectedinherited
void beamlinereco::WCTrackReco::produce ( art::Event evt)
virtual

Implements art::EDProducer.

Definition at line 167 of file WCTrackReco_module.cc.

References rawdata::RawBeamlineConfig::BeamlineRun(), util::CreateAssn(), beamlinereco::WCHitFinderAlg::createHits(), e, allTimeWatchdog::endl, fDist_to_Mag_Axis, beamlineutil::BeamlineMagneticField::FieldFromCurrent(), art::fill_ptr_vector(), fMagneticField, fMCenterDataLabel, fPhi_Dist, fRawBeamlineConfigLabel, fRawWCDataLabel, fReco_P, fTheta_Dist, fUseIFDB, fVerbose, fVertexTime, fWCDist, fWCHitFinderAlg, fWCTrackAlg, fX_Dist, fX_Face_Dist, fX_Mag_Int, fY_Dist, fY_Face_Dist, fY_Kink, fY_Mag_Int, fZ_Dist, fZ_Mag_Int, art::DataViewImpl::getByLabel(), art::Handle< T >::isValid(), beamlineutil::BeamlineMagneticField::MagneticField(), sumdata::MCenterData::mc7magnet, stan::math::Phi(), art::Event::put(), beamlinereco::WCTrackAlg::reconstructTracks(), beamlinereco::WCTrackAlg::setMagneticField(), novaddt::Theta(), X, Y, and Z.

167  {
168 
169  // data products to be made
170  std::unique_ptr<std::vector<brb::WCTrack> > wc_reco(new std::vector<brb::WCTrack>);
171  std::unique_ptr<art::Assns<brb::WCTrack, rawdata::RawBeamlineWC> >
173  std::unique_ptr<std::vector<rb::Vertex> > wc_vtx(new std::vector<rb::Vertex>);
174  std::unique_ptr<art::Assns<rb::Vertex, brb::WCTrack> >
175  vtx_to_wc_trk(new art::Assns<rb::Vertex, brb::WCTrack>);
176 
177  // get the raw WC digits
179  std::vector<art::Ptr<rawdata::RawBeamlineWC> > wcs;
180  if (evt.getByLabel(fRawWCDataLabel, wcHandle))
181  art::fill_ptr_vector(wcs, wcHandle);
182 
184  evt.getByLabel(fMCenterDataLabel, ifdb);
185  // get the magnetic field
186  float b_field = 0.;
187  // If spill is not found, magnet current will be set to -1e10.
188  // In this case, fallback on final else to use beamline run to find magnet current in fcl.
189  if ( fUseIFDB && ifdb.isValid() && ifdb->mc7magnet!=-1e10 )
190  b_field = fMagneticField->FieldFromCurrent(ifdb->mc7magnet);
191  else if ( fUseIFDB && !ifdb.isValid() ) {
192  mf::LogInfo("TBSpillInfo") << "MW: Change in reconstruction, March 27.\n"
193  << "The magnet information is now obtained from IFDB via the TBSpillInfo module, which need to be run first.\n"
194  << "Be sure to have run this module before WCTrackReco. (Alternatively, turn off the fUseIFDB flag (temporary))."
195  << std::endl;
196  abort();
197  }
198  else {
200  unsigned int beamline_run = 0;
201  //float b_field = -1.;
202  if (evt.getByLabel(fRawBeamlineConfigLabel, blConfigHandle)) {
203  //b_field = blConfigHandle->BField();
204  beamline_run = blConfigHandle->BeamlineRun();
205  }
206  try {
207  b_field = fMagneticField->MagneticField(beamline_run);
208  }
209  catch (cet::exception& e) {
210  e.what();
211  }
212  }
213  fWCTrackAlg.setMagneticField(b_field);
214 
215  // Find hits
216  std::vector<std::vector<WCHitList> > good_hits; // Two vectors: WC#, axis
218  good_hits,
219  fVerbose);
220 
221  // Find tracks
222  std::vector<double> reco_p_list;
223  std::vector<TVector3> mag_int_list;
224  std::vector<double> dist_to_mag_axis_list;
225  std::vector<TVector2> face_list;
226  std::vector<std::vector<TVector3> > wc_hit_pos_list;
227  std::vector<TVector3> dir_list;
228  std::vector<double> y_kink_list;
229  std::vector<TVector3> dist_list;
230  std::vector<WCHitList> final_tracks;
231  float residual;
232  int WCMissed;
233  fWCTrackAlg.reconstructTracks(reco_p_list,
234  mag_int_list,
235  dist_to_mag_axis_list,
236  face_list,
237  wc_hit_pos_list,
238  dir_list,
239  final_tracks,
240  good_hits,
241  y_kink_list,
242  dist_list,
243  WCMissed,
244  fWCDist,
245  residual);
246 
247  for (unsigned int iNewTrack = 0; iNewTrack < final_tracks.size(); ++iNewTrack) {
248 
249  WCHitList final_track = final_tracks[iNewTrack];
250 
251  // std::cout << "Making track with p " << reco_p_list[iNewTrack] << std::endl
252  // << "y kink " << y_kink_list[iNewTrack] << std::endl
253  // << "dist (" << dist_list[iNewTrack].X() << ", " << dist_list[iNewTrack].Y() << ", " << dist_list[iNewTrack].Z() << ")" << std::endl
254  // << "face (" << face_list[iNewTrack].X() << ", " << face_list[iNewTrack].Y() << ")" << std::endl
255  // << "wc 0 hit " << wc_hit_pos_list[iNewTrack][0].X() << ", " << wc_hit_pos_list[iNewTrack][0].Y() << ", " << wc_hit_pos_list[iNewTrack][0].Z() << ")" << std::endl
256  // << "wc 1 hit " << wc_hit_pos_list[iNewTrack][1].X() << ", " << wc_hit_pos_list[iNewTrack][1].Y() << ", " << wc_hit_pos_list[iNewTrack][1].Z() << ")" << std::endl
257  // << "wc 2 hit " << wc_hit_pos_list[iNewTrack][2].X() << ", " << wc_hit_pos_list[iNewTrack][2].Y() << ", " << wc_hit_pos_list[iNewTrack][2].Z() << ")" << std::endl
258  // << "wc 3 hit " << wc_hit_pos_list[iNewTrack][3].X() << ", " << wc_hit_pos_list[iNewTrack][3].Y() << ", " << wc_hit_pos_list[iNewTrack][3].Z() << ")" << std::endl
259  // << "dir " << dir_list[iNewTrack].X() << ", " << dir_list[iNewTrack].Y() << ", " << dir_list[iNewTrack].Z() << ")" << std::endl
260  // << "theta " << dir_list[iNewTrack].Theta() << std::endl
261  // << "phi " << dir_list[iNewTrack].Phi() << std::endl
262  // << "residual " << residual << std::endl;
263 
264  brb::WCTrack the_track(reco_p_list[iNewTrack],
265  y_kink_list[iNewTrack],
266  dist_list[iNewTrack],
267  mag_int_list[iNewTrack],
268  dist_to_mag_axis_list[iNewTrack],
269  face_list[iNewTrack],
270  wc_hit_pos_list[iNewTrack],
271  dir_list[iNewTrack],
272  dir_list[iNewTrack].Theta(),
273  dir_list[iNewTrack].Phi(),
274  residual);
275 
276  fReco_P->Fill(reco_p_list[iNewTrack]);
277  fY_Kink->Fill(y_kink_list[iNewTrack]);
278  fX_Dist->Fill(dist_list[iNewTrack].X());
279  fY_Dist->Fill(dist_list[iNewTrack].Y());
280  fZ_Dist->Fill(dist_list[iNewTrack].Z());
281  fX_Mag_Int->Fill(mag_int_list[iNewTrack].X());
282  fY_Mag_Int->Fill(mag_int_list[iNewTrack].Y());
283  fZ_Mag_Int->Fill(mag_int_list[iNewTrack].Z());
284  fDist_to_Mag_Axis->Fill(dist_to_mag_axis_list[iNewTrack]);
285  fX_Face_Dist->Fill(face_list[iNewTrack].X());
286  fY_Face_Dist->Fill(face_list[iNewTrack].Y());
287  fTheta_Dist->Fill(dir_list[iNewTrack].Theta());
288  fPhi_Dist->Fill(dir_list[iNewTrack].Phi());
289 
290  // create vertex for detector
291  rb::Vertex vtx(face_list[iNewTrack].X(),face_list[iNewTrack].Y(),0,fVertexTime);
292 
293  // add to output data product and make associations
294  (*wc_reco).push_back(the_track);
295  util::CreateAssn(*this, evt, *(wc_reco.get()), wcs, *(wc_assn.get()));
296  (*wc_vtx).push_back(vtx);
297  util::CreateAssn(*this, evt, *(vtx_to_wc_trk.get()), *(wc_vtx.get()), *(wc_reco.get()));
298 
299  }
300 
301  evt.put(std::move(wc_reco));
302  evt.put(std::move(wc_assn));
303  evt.put(std::move(wc_vtx));
304  evt.put(std::move(vtx_to_wc_trk));
305 
306  return;
307 
308 }
A 3D position and time representing an interaction vertex.
Definition: Vertex.h:15
static bool CreateAssn(art::EDProducer const &prod, art::Event &evt, std::vector< T > &a, art::Ptr< U > b, art::Assns< T, U > &assn, size_t indx=UINT_MAX, std::string const &instance=std::string())
Create a 1 to 1 association between a new product and one already in the event.
void createHits(const std::vector< art::Ptr< rawdata::RawBeamlineWC > > &wcs, std::vector< std::vector< WCHitList > > &good_hits, bool verbose)
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
void setMagneticField(float field)
Definition: WCTrackAlg.cxx:517
unsigned int BeamlineRun() const
Definition: RawBeamline.cxx:30
::xsd::cxx::tree::exception< char > exception
Definition: Database.h:225
This module reads IFDB DB and then stores BNB spill info.
art::ServiceHandle< beamlineutil::BeamlineMagneticField > fMagneticField
Float_t Y
Definition: plot.C:38
Float_t Z
Definition: plot.C:38
ProductID put(std::unique_ptr< PROD > &&product)
Definition: Event.h:102
bool isValid() const
Definition: Handle.h:189
fvar< T > Phi(const fvar< T > &x)
Definition: Phi.hpp:12
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Definition: DataViewImpl.h:344
float FieldFromCurrent(float magnet_current)
Convert magnet current to magnetic field using field mapping information.
double mc7magnet
Tertiary beamline magnet current [Amps].
Definition: MCenterData.h:29
float MagneticField(unsigned int beamline_run)
Return the magnetic field for a given beamline data run.
void fill_ptr_vector(std::vector< Ptr< T >> &ptrs, H const &h)
Definition: Ptr.h:464
Float_t e
Definition: plot.C:35
Float_t X
Definition: plot.C:38
void reconstructTracks(std::vector< double > &reco_p_list, std::vector< TVector3 > &mag_int_list, std::vector< double > &dist_to_mag_axis_list, std::vector< TVector2 > &face_list, std::vector< std::vector< TVector3 > > &wc_hit_pos_list, std::vector< TVector3 > &dir_list, std::vector< WCHitList > &event_final_tracks, std::vector< std::vector< WCHitList > > &good_hits, std::vector< double > &y_kink_list, std::vector< TVector3 > &dist_list, int &WCMissed, TH1F *&WCdistribution, float &residual)
Main function called for each event.
Definition: WCTrackAlg.cxx:63
const float Theta() const
Definition: HoughPeak.h:88
void beamlinereco::WCTrackReco::reconfigure ( const fhicl::ParameterSet pset)

Definition at line 107 of file WCTrackReco_module.cc.

References fMCenterDataLabel, fRawBeamlineConfigLabel, fRawWCDataLabel, fUseIFDB, fVerbose, fVertexTime, fhicl::ParameterSet::get(), and string.

Referenced by WCTrackReco().

107  {
108  fRawWCDataLabel = pset.get<art::InputTag>("RawWCDataLabel");
109  fRawBeamlineConfigLabel = pset.get<std::string> ("RawBeamlineConfigLabel");
110  fMCenterDataLabel = pset.get<std::string> ("MCenterDataLabel");
111  fVerbose = pset.get<bool> ("Verbose", false);
112  fUseIFDB = pset.get<bool> ("UseIFDB");
113  fVertexTime = pset.get<double> ("VertexTime");
114 }
T get(std::string const &key) const
Definition: ParameterSet.h:231
enum BeamMode string
void art::Consumer::showMissingConsumes ( ) const
protectedinherited

Referenced by art::RootOutput::endJob().

void art::Consumer::validateConsumedProduct ( BranchType const  bt,
ProductInfo const &  pi 
)
protectedinherited

Member Data Documentation

TH1F* beamlinereco::WCTrackReco::fDist_to_Mag_Axis
private

Definition at line 75 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

art::ServiceHandle<beamlineutil::BeamlineMagneticField> beamlinereco::WCTrackReco::fMagneticField
private

Definition at line 86 of file WCTrackReco_module.cc.

Referenced by produce().

art::InputTag beamlinereco::WCTrackReco::fMCenterDataLabel
private

Definition at line 58 of file WCTrackReco_module.cc.

Referenced by produce(), and reconfigure().

TH1F* beamlinereco::WCTrackReco::fPhi_Dist
private

Definition at line 79 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

bool beamlinereco::WCTrackReco::fPickyTracks
private

Definition at line 62 of file WCTrackReco_module.cc.

art::InputTag beamlinereco::WCTrackReco::fRawBeamlineConfigLabel
private

Definition at line 57 of file WCTrackReco_module.cc.

Referenced by produce(), and reconfigure().

art::InputTag beamlinereco::WCTrackReco::fRawWCDataLabel
private

Definition at line 56 of file WCTrackReco_module.cc.

Referenced by produce(), and reconfigure().

TH1F* beamlinereco::WCTrackReco::fReco_P
private

Definition at line 67 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

TH1F* beamlinereco::WCTrackReco::fTheta_Dist
private

Definition at line 78 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

TH1F* beamlinereco::WCTrackReco::fTrack_Type
private

Definition at line 80 of file WCTrackReco_module.cc.

Referenced by beginJob().

bool beamlinereco::WCTrackReco::fUseIFDB
private

Definition at line 63 of file WCTrackReco_module.cc.

Referenced by produce(), and reconfigure().

bool beamlinereco::WCTrackReco::fVerbose
private

Definition at line 61 of file WCTrackReco_module.cc.

Referenced by produce(), and reconfigure().

double beamlinereco::WCTrackReco::fVertexTime
private

Definition at line 64 of file WCTrackReco_module.cc.

Referenced by produce(), and reconfigure().

TH1F* beamlinereco::WCTrackReco::fWCDist
private

Definition at line 81 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

WCHitFinderAlg beamlinereco::WCTrackReco::fWCHitFinderAlg
private

Definition at line 84 of file WCTrackReco_module.cc.

Referenced by produce().

WCTrackAlg beamlinereco::WCTrackReco::fWCTrackAlg
private

Definition at line 85 of file WCTrackReco_module.cc.

Referenced by produce().

TH1F* beamlinereco::WCTrackReco::fX_Dist
private

Definition at line 69 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

TH1F* beamlinereco::WCTrackReco::fX_Face_Dist
private

Definition at line 76 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

TH1F* beamlinereco::WCTrackReco::fX_Mag_Int
private

Definition at line 72 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

TH1F* beamlinereco::WCTrackReco::fY_Dist
private

Definition at line 70 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

TH1F* beamlinereco::WCTrackReco::fY_Face_Dist
private

Definition at line 77 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

TH1F* beamlinereco::WCTrackReco::fY_Kink
private

Definition at line 68 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

TH1F* beamlinereco::WCTrackReco::fY_Mag_Int
private

Definition at line 73 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

TH1F* beamlinereco::WCTrackReco::fZ_Dist
private

Definition at line 71 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().

TH1F* beamlinereco::WCTrackReco::fZ_Mag_Int
private

Definition at line 74 of file WCTrackReco_module.cc.

Referenced by beginJob(), and produce().


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