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) const
 Runs the algorithm. More...
 
 ~FP420TrackMain ()
 

Private Attributes

double chiCutX_
 
double chiCutY_
 
int dn0
 
double dXX_
 
double dYY_
 
TrackProducerFP420 const * finderParameters_
 
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 14 of file FP420TrackMain.h.

Constructor & Destructor Documentation

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

Definition at line 24 of file FP420TrackMain.cc.

References gather_cfg::cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), AlCaHLTBitMon_QueryRunRegistry::string, and HLT_FULL_cff::verbosity.

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

Definition at line 146 of file FP420TrackMain.cc.

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

Member Function Documentation

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

Runs the algorithm.

Definition at line 152 of file FP420TrackMain.cc.

References TrackFP420::ax(), TrackFP420::ay(), TrackFP420::bx(), TrackFP420::by(), TrackFP420::chi2x(), TrackFP420::chi2y(), gather_cfg::cout, first, TrackCollectionFP420::get(), pileupCalc::inputRange, TrackFP420::nclusterx(), TrackFP420::nclustery(), TrackCollectionFP420::put(), and HLT_FULL_cff::verbosity.

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

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

Member Data Documentation

double FP420TrackMain::chiCutX_
private

Definition at line 64 of file FP420TrackMain.h.

double FP420TrackMain::chiCutY_
private

Definition at line 65 of file FP420TrackMain.h.

int FP420TrackMain::dn0
private

Definition at line 30 of file FP420TrackMain.h.

double FP420TrackMain::dXX_
private

Definition at line 62 of file FP420TrackMain.h.

double FP420TrackMain::dYY_
private

Definition at line 63 of file FP420TrackMain.h.

TrackProducerFP420 const* FP420TrackMain::finderParameters_
private

Definition at line 23 of file FP420TrackMain.h.

double FP420TrackMain::gapBlade_
private

Definition at line 60 of file FP420TrackMain.h.

double FP420TrackMain::pitchX_
private

Definition at line 50 of file FP420TrackMain.h.

double FP420TrackMain::pitchXW_
private

Definition at line 52 of file FP420TrackMain.h.

double FP420TrackMain::pitchY_
private

Definition at line 51 of file FP420TrackMain.h.

double FP420TrackMain::pitchYW_
private

Definition at line 53 of file FP420TrackMain.h.

int FP420TrackMain::pn0_
private

Definition at line 34 of file FP420TrackMain.h.

int FP420TrackMain::rn0_
private

Definition at line 36 of file FP420TrackMain.h.

int FP420TrackMain::sn0_
private

Definition at line 32 of file FP420TrackMain.h.

std::string FP420TrackMain::trackMode_
private

Definition at line 24 of file FP420TrackMain.h.

bool FP420TrackMain::UseHalfPitchShiftInX_
private

Definition at line 40 of file FP420TrackMain.h.

bool FP420TrackMain::UseHalfPitchShiftInXW_
private

Definition at line 43 of file FP420TrackMain.h.

bool FP420TrackMain::UseHalfPitchShiftInY_
private

Definition at line 41 of file FP420TrackMain.h.

bool FP420TrackMain::UseHalfPitchShiftInYW_
private

Definition at line 44 of file FP420TrackMain.h.

bool FP420TrackMain::validTrackerizer_
private

Definition at line 26 of file FP420TrackMain.h.

int FP420TrackMain::verbosity
private

Definition at line 28 of file FP420TrackMain.h.

double FP420TrackMain::XsensorSize_
private

Definition at line 69 of file FP420TrackMain.h.

int FP420TrackMain::xytype_
private

Definition at line 38 of file FP420TrackMain.h.

double FP420TrackMain::YsensorSize_
private

Definition at line 70 of file FP420TrackMain.h.

double FP420TrackMain::z420_
private

Definition at line 47 of file FP420TrackMain.h.

double FP420TrackMain::zBlade_
private

Definition at line 59 of file FP420TrackMain.h.

double FP420TrackMain::zD2_
private

Definition at line 48 of file FP420TrackMain.h.

double FP420TrackMain::zD3_
private

Definition at line 49 of file FP420TrackMain.h.

double FP420TrackMain::ZGapLDet_
private

Definition at line 54 of file FP420TrackMain.h.

double FP420TrackMain::zinibeg_
private

Definition at line 67 of file FP420TrackMain.h.

double FP420TrackMain::ZSiDet_
private

Definition at line 58 of file FP420TrackMain.h.

double FP420TrackMain::ZSiPlane_
private

Definition at line 57 of file FP420TrackMain.h.

double FP420TrackMain::ZSiStep_
private

Definition at line 56 of file FP420TrackMain.h.