CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Private Attributes
FP420TrackMain Class Reference

#include <FP420TrackMain.h>

Public Member Functions

 FP420TrackMain (const edm::ParameterSet &conf)
 
void run (edm::Handle< ClusterCollectionFP420 > &input, TrackCollectionFP420 *toutput)
 Runs the algorithm. More...
 
 ~FP420TrackMain ()
 

Private Attributes

double chiCutX_
 
double chiCutY_
 
edm::ParameterSet conf_
 
int dn0
 
double dXX_
 
double dYY_
 
TrackProducerFP420finderParameters_
 
double gapBlade_
 
double pitchX_
 
double pitchXW_
 
double pitchY_
 
double pitchYW_
 
int pn0_
 
int rn0_
 
int sn0_
 
std::string trackMode_
 
bool UseHalfPitchShiftInX_
 
bool UseHalfPitchShiftInXW_
 
bool UseHalfPitchShiftInY_
 
bool UseHalfPitchShiftInYW_
 
bool validTrackerizer_
 
int verbosity
 
double XsensorSize_
 
int xytype_
 
double YsensorSize_
 
double z420_
 
double zBlade_
 
double zD2_
 
double zD3_
 
double ZGapLDet_
 
double zinibeg_
 
double ZSiDet_
 
double ZSiPlane_
 
double ZSiStep_
 

Detailed Description

Definition at line 21 of file FP420TrackMain.h.

Constructor & Destructor Documentation

FP420TrackMain::FP420TrackMain ( const edm::ParameterSet conf)

Definition at line 23 of file FP420TrackMain.cc.

References chiCutX_, chiCutY_, conf_, gather_cfg::cout, dn0, dXX_, dYY_, finderParameters_, gapBlade_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), pitchX_, pitchXW_, pitchY_, pitchYW_, pn0_, rn0_, sn0_, AlCaHLTBitMon_QueryRunRegistry::string, trackMode_, UseHalfPitchShiftInX_, UseHalfPitchShiftInXW_, UseHalfPitchShiftInY_, UseHalfPitchShiftInYW_, validTrackerizer_, verbosity, XsensorSize_, xytype_, YsensorSize_, z420_, zBlade_, zD2_, zD3_, ZGapLDet_, zinibeg_, ZSiDet_, ZSiPlane_, and ZSiStep_.

23  : conf_(conf) {
24  verbosity = conf_.getUntrackedParameter<int>("VerbosityLevel");
25  trackMode_ = conf_.getParameter<std::string>("TrackModeFP420");
26  dn0 = conf_.getParameter<int>("NumberFP420Detectors");
27  sn0_ = conf_.getParameter<int>("NumberFP420Stations");
28  pn0_ = conf_.getParameter<int>("NumberFP420SPlanes");
29  rn0_ = 7;
30  xytype_ = conf_.getParameter<int>("NumberFP420SPTypes");
31  z420_ = conf_.getParameter<double>("z420");
32  zD2_ = conf_.getParameter<double>("zD2");
33  zD3_ = conf_.getParameter<double>("zD3");
34  dXX_ = conf_.getParameter<double>("dXXFP420");
35  dYY_ = conf_.getParameter<double>("dYYFP420");
36  chiCutX_ = conf_.getParameter<double>("chiCutX420");
37  chiCutY_ = conf_.getParameter<double>("chiCutY420");
38 
39  if (verbosity > 0) {
40  std::cout << "FP420TrackMain constructor::" << std::endl;
41  std::cout << "sn0=" << sn0_ << " pn0=" << pn0_ << " xytype=" << xytype_ << std::endl;
42  std::cout << "trackMode = " << trackMode_ << std::endl;
43  std::cout << "dXX=" << dXX_ << " dYY=" << dYY_ << std::endl;
44  std::cout << "chiCutX=" << chiCutX_ << " chiCutY=" << chiCutY_ << std::endl;
45  }
47  // zD2_ = 1000.; // dist between centers of 1st and 2nd stations
48  // zD3_ = 8000.; // dist between centers of 1st and 3rd stations
49 
50  UseHalfPitchShiftInX_ = true;
52  UseHalfPitchShiftInY_ = true;
54 
55  pitchX_ = 0.050;
56  pitchY_ = 0.050; //
57  pitchXW_ = 0.400;
58  pitchYW_ = 0.400; //
59 
60  XsensorSize_ = 8.0;
61  YsensorSize_ = 7.2;
62 
63  //
64  zBlade_ = 5.00;
65  gapBlade_ = 1.6;
66  double gapSupplane = 1.6;
67  ZSiPlane_ = 2 * zBlade_ + gapBlade_ + gapSupplane;
68 
69  double ZKapton = 0.1;
70  ZSiStep_ = ZSiPlane_ + ZKapton;
71 
72  double ZBoundDet = 0.020;
73  double ZSiElectr = 0.250;
74  double ZCeramDet = 0.500;
75 
76  double eee1 = 11.;
77  double eee2 = 12.;
78  zinibeg_ = (eee1 - eee2) / 2.;
79  //
80  ZSiDet_ = 0.250;
81  //
82  ZGapLDet_ = zBlade_ / 2 - (ZSiDet_ + ZSiElectr + ZBoundDet + ZCeramDet / 2);
83  //
84  if (verbosity > 1) {
85  std::cout << "FP420TrackMain constructor::" << std::endl;
86  std::cout << " zD2=" << zD2_ << " zD3=" << zD3_ << " zinibeg =" << zinibeg_ << std::endl;
87  std::cout << " UseHalfPitchShiftInX=" << UseHalfPitchShiftInX_ << " UseHalfPitchShiftInY=" << UseHalfPitchShiftInY_
88  << std::endl;
89  std::cout << " UseHalfPitchShiftInXW=" << UseHalfPitchShiftInXW_
90  << " UseHalfPitchShiftInYW=" << UseHalfPitchShiftInYW_ << std::endl;
91  std::cout << " pitchX=" << pitchX_ << " pitchY=" << pitchY_ << std::endl;
92  std::cout << " pitchXW=" << pitchXW_ << " pitchYW=" << pitchYW_ << std::endl;
93  std::cout << " zBlade_=" << zBlade_ << " gapBlade_=" << gapBlade_ << std::endl;
94  std::cout << " ZKapton=" << ZKapton << " ZBoundDet=" << ZBoundDet << std::endl;
95  std::cout << " ZSiElectr=" << ZSiElectr << " ZCeramDet=" << ZCeramDet << std::endl;
96  std::cout << " ZSiDet=" << ZSiDet_ << " gapSupplane=" << gapSupplane << std::endl;
97  }
99 
100  if (trackMode_ == "TrackProducerSophisticatedFP420") {
101  //trackMode_ == "TrackProducerVar1FP420" ||
102  //trackMode_ == "TrackProducerVar2FP420" ||
103 
104  // if ( trackMode_ == "TrackProducerMaxAmplitudeFP420" ||
105  // trackMode_ == "TrackProducerMaxAmplitude2FP420" ||
106  // trackMode_ == "TrackProducerSophisticatedFP420" ||
107  // trackMode_ == "TrackProducer3DFP420" ) {
108 
110  pn0_,
111  rn0_,
112  xytype_,
113  z420_,
114  zD2_,
115  zD3_,
116  pitchX_,
117  pitchY_,
118  pitchXW_,
119  pitchYW_,
120  ZGapLDet_,
121  ZSiStep_,
122  ZSiPlane_,
123  ZSiDet_,
124  zBlade_,
125  gapBlade_,
130  dXX_,
131  dYY_,
132  chiCutX_,
133  chiCutY_,
134  zinibeg_,
135  verbosity,
136  XsensorSize_,
137  YsensorSize_);
138  validTrackerizer_ = true;
139  } else {
140  std::cout << "ERROR:FP420TrackMain: No valid finder selected" << std::endl;
141  validTrackerizer_ = false;
142  }
143 }
T getUntrackedParameter(std::string const &, T const &) const
bool UseHalfPitchShiftInY_
bool UseHalfPitchShiftInXW_
bool UseHalfPitchShiftInX_
edm::ParameterSet conf_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
bool UseHalfPitchShiftInYW_
TrackProducerFP420 * finderParameters_
tuple cout
Definition: gather_cfg.py:144
std::string trackMode_
FP420TrackMain::~FP420TrackMain ( )

Definition at line 145 of file FP420TrackMain.cc.

References finderParameters_.

145  {
146  if (finderParameters_ != nullptr) {
147  delete finderParameters_;
148  }
149 }
TrackProducerFP420 * finderParameters_

Member Function Documentation

void FP420TrackMain::run ( edm::Handle< ClusterCollectionFP420 > &  input,
TrackCollectionFP420 toutput 
)

Runs the algorithm.

Definition at line 151 of file FP420TrackMain.cc.

References TrackFP420::ax(), TrackFP420::ay(), TrackFP420::bx(), TrackFP420::by(), TrackFP420::chi2x(), TrackFP420::chi2y(), gather_cfg::cout, dn0, finderParameters_, first, TrackCollectionFP420::get(), pileupCalc::inputRange, TrackFP420::nclusterx(), TrackFP420::nclustery(), TrackCollectionFP420::put(), TrackProducerFP420::trackFinderSophisticated(), trackMode_, validTrackerizer_, and verbosity.

Referenced by cms::TrackerizerFP420::produce().

151  {
152  if (validTrackerizer_) {
153  int number_detunits = 0;
154  int number_localelectroderechits = 0;
155  /*
156  for (int sector=1; sector<sn0_; sector++) {
157  for (int zmodule=1; zmodule<pn0_; zmodule++) {
158  for (int zside=1; zside<rn0_; zside++) {
159  int sScale = 2*(pn0-1);
160  // int index = FP420NumberingScheme::packFP420Index(det, zside, sector, zmodule);
161  // intindex is a continues numbering of FP420
162  int zScale=2; unsigned int detID = sScale*(sector - 1)+zScale*(zmodule - 1)+zside;
163  ClusterMap.clear();
164  ClusterCollectionFP420::Range clusterRange;
165  clusterRange = input.get(detID);
166  ClusterCollectionFP420::ContainerIterator clusterRangeIteratorBegin = clusterRange.first;
167  ClusterCollectionFP420::ContainerIterator clusterRangeIteratorEnd = clusterRange.second;
168  for ( ;sort_begin != sort_end; ++sort_begin ) {
169  ClusterMap.push_back(*sort_begin);
170  } // for
171 
172  }//for
173  }//for
174  }//for
175  */
176  // get vector of detunit ids
177  // const std::vector<unsigned int> detIDs = input->detIDs();
178 
179  // to be used in put (besause of 0 in track collection for: 1) 1st track and 2) case of no track)
180  // ignore 0, but to save info for 1st track record it second time on place 1 .
181 
182  bool first = true;
183  // loop over detunits
184  for (int det = 1; det < dn0; det++) {
185  ++number_detunits;
186  int StID = 1111;
187  if (det == 2)
188  StID = 2222;
189  std::vector<TrackFP420> collector;
190  // std::vector<TrackFP420> collector;
191  collector.clear();
192 
193  // if ( trackMode_ == "TrackProducerMaxAmplitudeFP420") {
194  // collector = finderParameters_->trackFinderMaxAmplitude(input); //std::vector<TrackFP420> collector;
195  // }// if ( trackMode
196  // else if (trackMode_ == "TrackProducerMaxAmplitude2FP420" ) {
197  // collector = finderParameters_->trackFinderMaxAmplitude2(input); //
198  // }// if ( trackMode
199  /*
200  else if (trackMode_ == "TrackProducerVar1FP420" ) {
201  collector = finderParameters_->trackFinderVar1(input); //
202  }// if ( trackMode
203  else if (trackMode_ == "TrackProducerVar2FP420" ) {
204  collector = finderParameters_->trackFinderVar2(input); //
205  }// if ( trackMode
206  */
207  if (trackMode_ == "TrackProducerSophisticatedFP420") {
208  collector = finderParameters_->trackFinderSophisticated(input, det); //
209  } // if ( trackMode
210 
211  // else if (trackMode_ == "TrackProducer3DFP420" ) {
212  // collector = finderParameters_->trackFinder3D(input); //
213  // }// if ( trackMode
214 
215  if (!collector.empty()) {
217  inputRange.first = collector.begin();
218  inputRange.second = collector.end();
219 
220  if (first) {
221  // use it only if TrackCollectionFP420 is the TrackCollection of one event, otherwise, do not use (loose 1st cl. of 1st event only)
222  first = false;
223  unsigned int StID0 = 0;
224  toutput->put(inputRange, StID0); // !!! put into adress 0 for detID which will not be used never
225  } //if ( first )
226 
227  // !!! put !!! put
228  toutput->put(inputRange, StID);
229 
230  number_localelectroderechits += collector.size();
231  } // if collector.size
232  } //for det loop
233 
234  if (verbosity > 0) {
235  std::cout << "FP420TrackMain: execution in mode " << trackMode_ << " generating " << number_localelectroderechits
236  << " tracks in " << number_detunits << " detectors" << std::endl;
237  }
238 
239  if (verbosity == -29) {
240  // check of access to the collector:
241  // loop over detunits
242  for (int det = 1; det < dn0; det++) {
243  int StID = 1111;
244  if (det == 2)
245  StID = 2222;
246  std::vector<TrackFP420> collector;
247  collector.clear();
248  TrackCollectionFP420::Range outputRange;
249  outputRange = toutput->get(StID);
250  // fill output in collector vector (for may be sorting? or other checks)
251  TrackCollectionFP420::ContainerIterator sort_begin = outputRange.first;
252  TrackCollectionFP420::ContainerIterator sort_end = outputRange.second;
253  for (; sort_begin != sort_end; ++sort_begin) {
254  collector.push_back(*sort_begin);
255  } // for
256  std::cout << " ===" << std::endl;
257  std::cout << " ===" << std::endl;
258  std::cout << "=======FP420TrackMain:check size = " << collector.size() << " det = " << det << std::endl;
259  std::cout << " ===" << std::endl;
260  std::cout << " ===" << std::endl;
261  vector<TrackFP420>::const_iterator simHitIter = collector.begin();
262  vector<TrackFP420>::const_iterator simHitIterEnd = collector.end();
263  // loop in #tracks
264  for (; simHitIter != simHitIterEnd; ++simHitIter) {
265  const TrackFP420 itrack = *simHitIter;
266 
267  std::cout << "FP420TrackMain:check: nclusterx = " << itrack.nclusterx()
268  << " nclustery = " << itrack.nclustery() << std::endl;
269  std::cout << " ax = " << itrack.ax() << " bx = " << itrack.bx() << std::endl;
270  std::cout << " ay = " << itrack.ay() << " by = " << itrack.by() << std::endl;
271  std::cout << " chi2x= " << itrack.chi2x() << " chi2y= " << itrack.chi2y() << std::endl;
272  std::cout << " ===" << std::endl;
273  std::cout << " ===" << std::endl;
274  std::cout << " =======================" << std::endl;
275  }
276 
277  //==================================
278 
279  // end of check of access to the strip collection
280  std::cout << "======= FP420TrackMain: end of check " << std::endl;
281 
282  } //for det
283  } // if verbosity
284 
285  } // if ( validTrackerizer_
286 }
std::vector< TrackFP420 > trackFinderSophisticated(edm::Handle< ClusterCollectionFP420 > input, int det)
int nclusterx() const
Definition: TrackFP420.h:17
double ax() const
Definition: TrackFP420.h:14
double by() const
Definition: TrackFP420.h:19
std::pair< ContainerIterator, ContainerIterator > Range
double chi2x() const
Definition: TrackFP420.h:16
double chi2y() const
Definition: TrackFP420.h:20
double ay() const
Definition: TrackFP420.h:18
std::vector< TrackFP420 >::const_iterator ContainerIterator
double bx() const
Definition: TrackFP420.h:15
const Range get(unsigned int stationID) const
tuple inputRange
Definition: pileupCalc.py:168
void put(Range input, unsigned int stationID)
int nclustery() const
Definition: TrackFP420.h:21
TrackProducerFP420 * finderParameters_
tuple cout
Definition: gather_cfg.py:144
std::string trackMode_

Member Data Documentation

double FP420TrackMain::chiCutX_
private

Definition at line 72 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::chiCutY_
private

Definition at line 73 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

edm::ParameterSet FP420TrackMain::conf_
private

Definition at line 30 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

int FP420TrackMain::dn0
private

Definition at line 38 of file FP420TrackMain.h.

Referenced by FP420TrackMain(), and run().

double FP420TrackMain::dXX_
private

Definition at line 70 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::dYY_
private

Definition at line 71 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

TrackProducerFP420* FP420TrackMain::finderParameters_
private

Definition at line 31 of file FP420TrackMain.h.

Referenced by FP420TrackMain(), run(), and ~FP420TrackMain().

double FP420TrackMain::gapBlade_
private

Definition at line 68 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::pitchX_
private

Definition at line 58 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::pitchXW_
private

Definition at line 60 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::pitchY_
private

Definition at line 59 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::pitchYW_
private

Definition at line 61 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

int FP420TrackMain::pn0_
private

Definition at line 42 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

int FP420TrackMain::rn0_
private

Definition at line 44 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

int FP420TrackMain::sn0_
private

Definition at line 40 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

std::string FP420TrackMain::trackMode_
private

Definition at line 32 of file FP420TrackMain.h.

Referenced by FP420TrackMain(), and run().

bool FP420TrackMain::UseHalfPitchShiftInX_
private

Definition at line 48 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

bool FP420TrackMain::UseHalfPitchShiftInXW_
private

Definition at line 51 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

bool FP420TrackMain::UseHalfPitchShiftInY_
private

Definition at line 49 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

bool FP420TrackMain::UseHalfPitchShiftInYW_
private

Definition at line 52 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

bool FP420TrackMain::validTrackerizer_
private

Definition at line 34 of file FP420TrackMain.h.

Referenced by FP420TrackMain(), and run().

int FP420TrackMain::verbosity
private

Definition at line 36 of file FP420TrackMain.h.

Referenced by FP420TrackMain(), and run().

double FP420TrackMain::XsensorSize_
private

Definition at line 77 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

int FP420TrackMain::xytype_
private

Definition at line 46 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::YsensorSize_
private

Definition at line 78 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::z420_
private

Definition at line 55 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::zBlade_
private

Definition at line 67 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::zD2_
private

Definition at line 56 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::zD3_
private

Definition at line 57 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::ZGapLDet_
private

Definition at line 62 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::zinibeg_
private

Definition at line 75 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::ZSiDet_
private

Definition at line 66 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::ZSiPlane_
private

Definition at line 65 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::ZSiStep_
private

Definition at line 64 of file FP420TrackMain.h.

Referenced by FP420TrackMain().