CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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, std::auto_ptr< 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 
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 
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_ << std::endl;
89  std::cout << " UseHalfPitchShiftInXW=" << UseHalfPitchShiftInXW_ << " UseHalfPitchShiftInYW=" << UseHalfPitchShiftInYW_ << std::endl;
90  std::cout << " pitchX=" << pitchX_ << " pitchY=" << pitchY_ << std::endl;
91  std::cout << " pitchXW=" << pitchXW_ << " pitchYW=" << pitchYW_ << std::endl;
92  std::cout << " zBlade_=" << zBlade_ << " gapBlade_=" << gapBlade_ << std::endl;
93  std::cout << " ZKapton=" << ZKapton << " ZBoundDet=" << ZBoundDet << std::endl;
94  std::cout << " ZSiElectr=" << ZSiElectr << " ZCeramDet=" << ZCeramDet << std::endl;
95  std::cout << " ZSiDet=" << ZSiDet_ << " gapSupplane=" << gapSupplane << std::endl;
96  }
98 
99 
100 
101  if ( trackMode_ == "TrackProducerSophisticatedFP420" ) {
102 
103 
104  //trackMode_ == "TrackProducerVar1FP420" ||
105  //trackMode_ == "TrackProducerVar2FP420" ||
106 
107  // if ( trackMode_ == "TrackProducerMaxAmplitudeFP420" ||
108 // trackMode_ == "TrackProducerMaxAmplitude2FP420" ||
109 // trackMode_ == "TrackProducerSophisticatedFP420" ||
110 // trackMode_ == "TrackProducer3DFP420" ) {
111 
112  finderParameters_ = new TrackProducerFP420(sn0_, pn0_, rn0_, xytype_, z420_, zD2_, zD3_,
113  pitchX_, pitchY_,
119  dXX_,dYY_,chiCutX_,chiCutY_,zinibeg_,verbosity,
121  validTrackerizer_ = true;
122  }
123  else {
124  std::cout << "ERROR:FP420TrackMain: No valid finder selected" << std::endl;
125  validTrackerizer_ = false;
126  }
127 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
bool UseHalfPitchShiftInY_
bool UseHalfPitchShiftInXW_
bool UseHalfPitchShiftInX_
edm::ParameterSet conf_
bool UseHalfPitchShiftInYW_
TrackProducerFP420 * finderParameters_
tuple cout
Definition: gather_cfg.py:121
std::string trackMode_
FP420TrackMain::~FP420TrackMain ( )

Definition at line 129 of file FP420TrackMain.cc.

References finderParameters_.

129  {
130  if ( finderParameters_ != 0 ) {
131  delete finderParameters_;
132  }
133 }
TrackProducerFP420 * finderParameters_

Member Function Documentation

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

Runs the algorithm.

Definition at line 137 of file FP420TrackMain.cc.

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

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

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

Member Data Documentation

double FP420TrackMain::chiCutX_
private

Definition at line 79 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::chiCutY_
private

Definition at line 80 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

edm::ParameterSet FP420TrackMain::conf_
private

Definition at line 36 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

int FP420TrackMain::dn0
private

Definition at line 45 of file FP420TrackMain.h.

Referenced by FP420TrackMain(), and run().

double FP420TrackMain::dXX_
private

Definition at line 77 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::dYY_
private

Definition at line 78 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

TrackProducerFP420* FP420TrackMain::finderParameters_
private

Definition at line 37 of file FP420TrackMain.h.

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

double FP420TrackMain::gapBlade_
private

Definition at line 75 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::pitchX_
private

Definition at line 65 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::pitchXW_
private

Definition at line 67 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::pitchY_
private

Definition at line 66 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::pitchYW_
private

Definition at line 68 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

int FP420TrackMain::pn0_
private

Definition at line 49 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

int FP420TrackMain::rn0_
private

Definition at line 51 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

int FP420TrackMain::sn0_
private

Definition at line 47 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

std::string FP420TrackMain::trackMode_
private

Definition at line 38 of file FP420TrackMain.h.

Referenced by FP420TrackMain(), and run().

bool FP420TrackMain::UseHalfPitchShiftInX_
private

Definition at line 55 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

bool FP420TrackMain::UseHalfPitchShiftInXW_
private

Definition at line 58 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

bool FP420TrackMain::UseHalfPitchShiftInY_
private

Definition at line 56 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

bool FP420TrackMain::UseHalfPitchShiftInYW_
private

Definition at line 59 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

bool FP420TrackMain::validTrackerizer_
private

Definition at line 41 of file FP420TrackMain.h.

Referenced by FP420TrackMain(), and run().

int FP420TrackMain::verbosity
private

Definition at line 43 of file FP420TrackMain.h.

Referenced by FP420TrackMain(), and run().

double FP420TrackMain::XsensorSize_
private

Definition at line 84 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

int FP420TrackMain::xytype_
private

Definition at line 53 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::YsensorSize_
private

Definition at line 85 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::z420_
private

Definition at line 62 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::zBlade_
private

Definition at line 74 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::zD2_
private

Definition at line 63 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::zD3_
private

Definition at line 64 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::ZGapLDet_
private

Definition at line 69 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::zinibeg_
private

Definition at line 82 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::ZSiDet_
private

Definition at line 73 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::ZSiPlane_
private

Definition at line 72 of file FP420TrackMain.h.

Referenced by FP420TrackMain().

double FP420TrackMain::ZSiStep_
private

Definition at line 71 of file FP420TrackMain.h.

Referenced by FP420TrackMain().