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 Member Functions | Private Attributes
HitEff Class Reference

#include <HitEff.h>

Inheritance diagram for HitEff:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

bool check2DPartner (unsigned int iidd, const std::vector< TrajectoryMeasurement > &traj)
 
double checkConsistency (const StripClusterParameterEstimator::LocalValues &parameters, double xx, double xerr)
 
unsigned int checkLayer (unsigned int iidd, const TrackerTopology *tTopo)
 
 HitEff (const edm::ParameterSet &conf)
 
bool isDoubleSided (unsigned int iidd, const TrackerTopology *tTopo) const
 
virtual ~HitEff ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &e, const edm::EventSetup &c)
 
virtual void beginJob ()
 
virtual void endJob ()
 

Private Attributes

unsigned int bunchx
 
float chi2
 
float ClusterLocErrX
 
float ClusterLocErrY
 
float ClusterLocX
 
float ClusterLocY
 
float ClusterStoN
 
edm::ParameterSet conf_
 
bool DEBUG
 
float dedx
 
int dedxNOM
 
unsigned int event
 
int events
 
int EventTrackCKF
 
unsigned int Id
 
int istep
 
unsigned int layers
 
unsigned int ModIsBad
 
int nHits
 
int nLostHits
 
float p
 
float pT
 
float ResX
 
float ResXSig
 
unsigned int run
 
unsigned int SiStripQualBad
 
float timeDT
 
int timeDTDOF
 
float timeDTErr
 
float timeECAL
 
int tquality
 
TTree * traj
 
float TrajGlbX
 
float TrajGlbY
 
float TrajGlbZ
 
unsigned int trajHitValid
 
float TrajLocAngleX
 
float TrajLocAngleY
 
float TrajLocErrX
 
float TrajLocErrY
 
float TrajLocX
 
float TrajLocY
 
unsigned int whatlayer
 
bool withinAcceptance
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 44 of file HitEff.h.

Constructor & Destructor Documentation

HitEff::HitEff ( const edm::ParameterSet conf)
explicit

Definition at line 72 of file HitEff.cc.

References conf_, DEBUG, edm::ParameterSet::getParameter(), and layers.

72  :
73  conf_(conf)
74 {
75  layers =conf_.getParameter<int>("Layer");
76  DEBUG = conf_.getParameter<bool>("Debug");
77 }
T getParameter(std::string const &) const
bool DEBUG
Definition: HitEff.h:66
unsigned int layers
Definition: HitEff.h:65
edm::ParameterSet conf_
Definition: HitEff.h:60
HitEff::~HitEff ( )
virtual

Definition at line 80 of file HitEff.cc.

80 { }

Member Function Documentation

void HitEff::analyze ( const edm::Event e,
const edm::EventSetup c 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 132 of file HitEff.cc.

References abs, AnalyticalPropagator_cfi::AnalyticalPropagator, anyDirection, edm::EventBase::bunchCrossing(), bunchx, check2DPartner(), checkConsistency(), checkLayer(), chi2, ClusterLocErrX, ClusterLocErrY, ClusterLocX, ClusterLocY, ClusterStoN, conf_, gather_cfg::cout, DEBUG, edm::EventID::event(), events, EventTrackCKF, edm::EventSetup::get(), edm::Event::getByLabel(), edm::ParameterSet::getParameter(), i, edm::EventBase::id(), Id, cuy::ii, LaserDQM_cfg::input, ires, isDoubleSided(), layers, ClusterParameterEstimator< T >::localParameters(), LayerMeasurements::measurements(), ModIsBad, reco::MuonTime::nDof, nHits, nLostHits, p, Parameters::parameters, edm::Handle< T >::product(), edm::ESHandle< class >::product(), LargeD0_PixelPairStep_cff::propagator, pT, L1Trigger_dataformats::reco, ResX, ResXSig, edm::EventID::run(), run, SiStripClusterInfo::signalOverNoise(), SiStripQualBad, mathSSE::sqrt(), StripSubdetector::TEC, TrackerTopology::tecSide(), reco::MuonTime::timeAtIpInOut, reco::MuonTime::timeAtIpInOutErr, timeDT, timeDTDOF, timeDTErr, timeECAL, tmp, patCandidatesForDimuonsSequences_cff::tracker, traj, TrajGlbX, TrajGlbY, TrajGlbZ, trajHitValid, TrajLocAngleX, TrajLocAngleY, TrajLocErrX, TrajLocErrY, TrajLocX, TrajLocY, whatlayer, and withinAcceptance.

132  {
133  //Retrieve tracker topology from geometry
134  edm::ESHandle<TrackerTopology> tTopoHandle;
135  es.get<IdealGeometryRecord>().get(tTopoHandle);
136  const TrackerTopology* const tTopo = tTopoHandle.product();
137 
138  // bool DEBUG = false;
139 
140  if (DEBUG) cout << "beginning analyze from HitEff" << endl;
141 
142  using namespace edm;
143  using namespace reco;
144  // Step A: Get Inputs
145 
146  int run_nr = e.id().run();
147  int ev_nr = e.id().event();
148  int bunch_nr = e.bunchCrossing();
149 
150  //CombinatoriaTrack
151  edm::Handle<reco::TrackCollection> trackCollectionCKF;
152  edm::InputTag TkTagCKF = conf_.getParameter<edm::InputTag>("combinatorialTracks");
153  e.getByLabel(TkTagCKF,trackCollectionCKF);
154 
155  edm::Handle<std::vector<Trajectory> > TrajectoryCollectionCKF;
156  edm::InputTag TkTrajCKF = conf_.getParameter<edm::InputTag>("trajectories");
157  e.getByLabel(TkTrajCKF,TrajectoryCollectionCKF);
158 
159  // Clusters
160  // get the SiStripClusters from the event
162  e.getByLabel("siStripClusters", theClusters);
163 
164  //get tracker geometry
166  es.get<TrackerDigiGeometryRecord>().get(tracker);
167  const TrackerGeometry * tkgeom=&(* tracker);
168 
169  //get Cluster Parameter Estimator
170  //std::string cpe = conf_.getParameter<std::string>("StripCPE");
172  es.get<TkStripCPERecord>().get("StripCPEfromTrackAngle", parameterestimator);
173  const StripClusterParameterEstimator &stripcpe(*parameterestimator);
174 
175  // get the SiStripQuality records
176  edm::ESHandle<SiStripQuality> SiStripQuality_;
177  try {
178  es.get<SiStripQualityRcd>().get("forCluster",SiStripQuality_);
179  }
180  catch (...) {
181  es.get<SiStripQualityRcd>().get(SiStripQuality_);
182  }
183 
184  edm::ESHandle<MagneticField> magFieldHandle;
185  es.get<IdealMagneticFieldRecord>().get(magFieldHandle);
186  const MagneticField* magField_ = magFieldHandle.product();
187 
188  // get the list of module IDs with FED-detected errors
189  edm::Handle< DetIdCollection > fedErrorIds;
190  e.getByLabel("siStripDigis", fedErrorIds );
191 
192  ESHandle<MeasurementTracker> measurementTrackerHandle;
193  es.get<CkfComponentsRecord>().get(measurementTrackerHandle);
194 
196  es.get<TrackingComponentsRecord>().get("Chi2",est);
197 
199  es.get<TrackingComponentsRecord>().get("PropagatorWithMaterial",prop);
200  const Propagator* thePropagator = prop.product();
201 
202  events++;
203 
204  // *************** SiStripCluster Collection
205  const edmNew::DetSetVector<SiStripCluster>& input = *theClusters;
206 
207  //go through clusters to write out global position of good clusters for the layer understudy for comparison
208  // Loop through clusters just to print out locations
209  // Commented out to avoid discussion, should really be deleted.
210  /*
211  for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter = input.begin(); DSViter != input.end(); DSViter++) {
212  // DSViter is a vector of SiStripClusters located on a single module
213  unsigned int ClusterId = DSViter->id();
214  DetId ClusterDetId(ClusterId);
215  const StripGeomDetUnit * stripdet=(const StripGeomDetUnit*)tkgeom->idToDetUnit(ClusterDetId);
216 
217  edmNew::DetSet<SiStripCluster>::const_iterator begin=DSViter->begin();
218  edmNew::DetSet<SiStripCluster>::const_iterator end =DSViter->end();
219  for(edmNew::DetSet<SiStripCluster>::const_iterator iter=begin;iter!=end;++iter) {
220  //iter is a single SiStripCluster
221  StripClusterParameterEstimator::LocalValues parameters=stripcpe.localParameters(*iter,*stripdet);
222 
223  const Surface* surface;
224  surface = &(tracker->idToDet(ClusterDetId)->surface());
225  LocalPoint lp = parameters.first;
226  GlobalPoint gp = surface->toGlobal(lp);
227  unsigned int layer = checkLayer(ClusterId, tTopo);
228  if(DEBUG) cout << "Found hit in cluster collection layer = " << layer << " with id = " << ClusterId << " local X position = " << lp.x() << " +- " << sqrt(parameters.second.xx()) << " matched/stereo/rphi = " << ((ClusterId & 0x3)==0) << "/" << ((ClusterId & 0x3)==1) << "/" << ((ClusterId & 0x3)==2) << endl;
229  }
230  }
231  */
232 
233  // Tracking
234  const reco::TrackCollection *tracksCKF=trackCollectionCKF.product();
235  if (DEBUG) cout << "number ckf tracks found = " << tracksCKF->size() << endl;
236  //if (tracksCKF->size() == 1 ){
237  if (tracksCKF->size() > 0 && tracksCKF->size()<100) {
238  if (DEBUG) cout << "starting checking good event with < 100 tracks" << endl;
239 
240  EventTrackCKF++;
241 
242  /*
243 
244  //get dEdx info if available
245  Handle<ValueMap<DeDxData> > dEdxUncalibHandle;
246  if (e.getByLabel("dedxMedianCTF", dEdxUncalibHandle)) {
247  const ValueMap<DeDxData> dEdxTrackUncalib = *dEdxUncalibHandle.product();
248 
249  reco::TrackRef itTrack = reco::TrackRef( trackCollectionCKF, 0 );
250  dedx = dEdxTrackUncalib[itTrack].dEdx();
251  dedxNOM = dEdxTrackUncalib[itTrack].numberOfMeasurements();
252  } else {
253  dedx = -999.0; dedxNOM = -999;
254  }
255 
256  */
257 
258  //get muon and ecal timing info if available
260  if(e.getByLabel("muonsWitht0Correction",muH)){
261  const MuonCollection & muonsT0 = *muH.product();
262  if(muonsT0.size()!=0) {
263  MuonTime mt0 = muonsT0[0].time();
264  timeDT = mt0.timeAtIpInOut;
266  timeDTDOF = mt0.nDof;
267 
268  bool hasCaloEnergyInfo = muonsT0[0].isEnergyValid();
269  if (hasCaloEnergyInfo) timeECAL = muonsT0[0].calEnergy().ecal_time;
270  }
271  } else {
272  timeDT = -999.0; timeDTErr = -999.0; timeDTDOF = -999; timeECAL = -999.0;
273  }
274 
275  // actually should do a loop over all the tracks in the event here
276 
277  for (vector<Trajectory>::const_iterator itraj = TrajectoryCollectionCKF.product()->begin();
278  itraj != TrajectoryCollectionCKF.product()->end();
279  itraj++) {
280 
281  // for each track, fill some variables such as number of hits and momentum
282  nHits = itraj->foundHits();
283  nLostHits = itraj->lostHits();
284  chi2 = (itraj->chiSquared()/itraj->ndof());
285  pT = sqrt( ( itraj->lastMeasurement().updatedState().globalMomentum().x() *
286  itraj->lastMeasurement().updatedState().globalMomentum().x()) +
287  ( itraj->lastMeasurement().updatedState().globalMomentum().y() *
288  itraj->lastMeasurement().updatedState().globalMomentum().y()) );
289  p = itraj->lastMeasurement().updatedState().globalMomentum().mag();
290 
291  //Put in code to check track quality
292 
293 
294  std::vector<TrajectoryMeasurement> TMeas=itraj->measurements();
295  vector<TrajectoryMeasurement>::iterator itm;
296  double xloc = 0.;
297  double yloc = 0.;
298  double xErr = 0.;
299  double yErr = 0.;
300  double angleX = -999.;
301  double angleY = -999.;
302  double xglob,yglob,zglob;
303 
304  for (itm=TMeas.begin();itm!=TMeas.end();itm++){
306  theInHit = (*itm).recHit();
307 
308  if(DEBUG) cout << "theInHit is valid = " << theInHit->isValid() << endl;
309 
310  unsigned int iidd = theInHit->geographicalId().rawId();
311 
312  unsigned int TKlayers = checkLayer(iidd, tTopo);
313  if (DEBUG) cout << "TKlayer from trajectory: " << TKlayers << " from module = " << iidd << " matched/stereo/rphi = " << ((iidd & 0x3)==0) << "/" << ((iidd & 0x3)==1) << "/" << ((iidd & 0x3)==2) << endl;
314 
315  // If Trajectory measurement from TOB 6 or TEC 9, skip it because it's always valid they are filled later
316  if ( TKlayers == 10 || TKlayers == 22 ) {
317  if (DEBUG) cout << "skipping original TM for TOB 6 or TEC 9" << endl;
318  continue;
319  }
320 
321  // Make vector of TrajectoryAtInvalidHits to hold the trajectories
322  std::vector<TrajectoryAtInvalidHit> TMs;
323 
324  // Make AnalyticalPropagator to use in TAVH constructor
326 
327  // for double sided layers check both sensors--if no hit was found on either sensor surface,
328  // the trajectory measurements only have one invalid hit entry on the matched surface
329  // so get the TrajectoryAtInvalidHit for both surfaces and include them in the study
330  if (isDoubleSided(iidd, tTopo) && ((iidd & 0x3)==0) ) {
331  // do hit eff check twice--once for each sensor
332  //add a TM for each surface
333  TMs.push_back(TrajectoryAtInvalidHit(*itm, tTopo, tkgeom, propagator, 1));
334  TMs.push_back(TrajectoryAtInvalidHit(*itm, tTopo, tkgeom, propagator, 2));
335  } else if ( isDoubleSided(iidd, tTopo) && (!check2DPartner(iidd, TMeas)) ) {
336  // if only one hit was found the trajectory measurement is on that sensor surface, and the other surface from
337  // the matched layer should be added to the study as well
338  TMs.push_back(TrajectoryAtInvalidHit(*itm, tTopo, tkgeom, propagator, 1));
339  TMs.push_back(TrajectoryAtInvalidHit(*itm, tTopo, tkgeom, propagator, 2));
340  if (DEBUG) cout << " found a hit with a missing partner" << endl;
341  } else {
342  //only add one TM for the single surface and the other will be added in the next iteration
343  TMs.push_back(TrajectoryAtInvalidHit(*itm, tTopo, tkgeom, propagator));
344  }
345 
347  //Now check for tracks at TOB6 and TEC9
348 
349  // to make sure we only propagate on the last TOB5 hit check the next entry isn't also in TOB5
350  // to avoid bias, make sure the TOB5 hit is valid (an invalid hit on TOB5 could only exist with a valid hit on TOB6)
351 
352  bool isValid = theInHit->isValid();
353  bool isLast = (itm==(TMeas.end()-1));
354  bool isLastTOB5 = true;
355  if (!isLast) {
356  if ( checkLayer((++itm)->recHit()->geographicalId().rawId(), tTopo) == 9 ) isLastTOB5 = false;
357  else isLastTOB5 = true;
358  --itm;
359  }
360 
361  if ( TKlayers==9 && isValid && isLastTOB5 ) {
362  // if ( TKlayers==9 && itm==TMeas.rbegin()) {
363  // if ( TKlayers==9 && (itm==TMeas.back()) ) { // to check for only the last entry in the trajectory for propagation
364  std::vector< BarrelDetLayer*> barrelTOBLayers = measurementTrackerHandle->geometricSearchTracker()->tobLayers() ;
365  const DetLayer* tob6 = barrelTOBLayers[barrelTOBLayers.size()-1];
366  const MeasurementEstimator* estimator = est.product();
367  const LayerMeasurements* theLayerMeasurements = new LayerMeasurements(&*measurementTrackerHandle);
368  const TrajectoryStateOnSurface tsosTOB5 = itm->updatedState();
369  vector<TrajectoryMeasurement> tmp = theLayerMeasurements->measurements(*tob6, tsosTOB5, *thePropagator, *estimator);
370 
371  if ( !tmp.empty()) {
372  if (DEBUG) cout << "size of TM from propagation = " << tmp.size() << endl;
373 
374  // take the last of the TMs, which is always an invalid hit
375  // if no detId is available, ie detId==0, then no compatible layer was crossed
376  // otherwise, use that TM for the efficiency measurement
377  TrajectoryMeasurement tob6TM(tmp.back());
379  tob6Hit = tob6TM.recHit();
380 
381  if (tob6Hit->geographicalId().rawId()!=0) {
382  if (DEBUG) cout << "tob6 hit actually being added to TM vector" << endl;
383  TMs.push_back(TrajectoryAtInvalidHit(tob6TM, tTopo, tkgeom, propagator));
384  }
385  }
386  }
387 
388  bool isLastTEC8 = true;
389  if (!isLast) {
390  if ( checkLayer((++itm)->recHit()->geographicalId().rawId(), tTopo) == 21 ) isLastTEC8 = false;
391  else isLastTEC8 = true;
392  --itm;
393  }
394 
395  if ( TKlayers==21 && isValid && isLastTEC8 ) {
396 
397  std::vector< ForwardDetLayer*> posTecLayers = measurementTrackerHandle->geometricSearchTracker()->posTecLayers() ;
398  const DetLayer* tec9pos = posTecLayers[posTecLayers.size()-1];
399  std::vector< ForwardDetLayer*> negTecLayers = measurementTrackerHandle->geometricSearchTracker()->negTecLayers() ;
400  const DetLayer* tec9neg = negTecLayers[negTecLayers.size()-1];
401 
402  const MeasurementEstimator* estimator = est.product();
403  const LayerMeasurements* theLayerMeasurements = new LayerMeasurements(&*measurementTrackerHandle);
404  const TrajectoryStateOnSurface tsosTEC9 = itm->updatedState();
405 
406  // check if track on positive or negative z
407  if (!iidd == StripSubdetector::TEC) cout << "there is a problem with TEC 9 extrapolation" << endl;
408 
409  //cout << " tec9 id = " << iidd << " and side = " << tTopo->tecSide(iidd) << endl;
410  vector<TrajectoryMeasurement> tmp;
411  if ( tTopo->tecSide(iidd) == 1 ) {
412  tmp = theLayerMeasurements->measurements(*tec9neg, tsosTEC9, *thePropagator, *estimator);
413  //cout << "on negative side" << endl;
414  }
415  if ( tTopo->tecSide(iidd) == 2 ) {
416  tmp = theLayerMeasurements->measurements(*tec9pos, tsosTEC9, *thePropagator, *estimator);
417  //cout << "on positive side" << endl;
418  }
419 
420  if ( !tmp.empty()) {
421  // take the last of the TMs, which is always an invalid hit
422  // if no detId is available, ie detId==0, then no compatible layer was crossed
423  // otherwise, use that TM for the efficiency measurement
424  TrajectoryMeasurement tec9TM(tmp.back());
426  tec9Hit = tec9TM.recHit();
427 
428  unsigned int tec9id = tec9Hit->geographicalId().rawId();
429  if (DEBUG) cout << "tec9id = " << tec9id << " is Double sided = " << isDoubleSided(tec9id, tTopo) << " and 0x3 = " << (tec9id & 0x3) << endl;
430 
431  if (tec9Hit->geographicalId().rawId()!=0) {
432  if (DEBUG) cout << "tec9 hit actually being added to TM vector" << endl;
433  // in tec the hit can be single or doubled sided. whenever the invalid hit at the end of vector of TMs is
434  // double sided it is always on the matched surface, so we need to split it into the true sensor surfaces
435  if (isDoubleSided(tec9id, tTopo)) {
436  TMs.push_back(TrajectoryAtInvalidHit(tec9TM, tTopo, tkgeom, propagator, 1));
437  TMs.push_back(TrajectoryAtInvalidHit(tec9TM, tTopo, tkgeom, propagator, 2));
438  } else
439  TMs.push_back(TrajectoryAtInvalidHit(tec9TM, tTopo, tkgeom, propagator));
440  }
441  } //else cout << "tec9 tmp empty" << endl;
442  }
443 
445 
446  // Modules Constraints
447 
448  for(std::vector<TrajectoryAtInvalidHit>::const_iterator TM=TMs.begin();TM!=TMs.end();++TM) {
449 
450  // --> Get trajectory from combinatedState
451  iidd = TM->monodet_id();
452  if (DEBUG) cout << "setting iidd = " << iidd << " before checking efficiency and ";
453 
454  xloc = TM->localX();
455  yloc = TM->localY();
456 
457  xErr = TM->localErrorX();
458  yErr = TM->localErrorY();
459 
460  angleX = atan( TM->localDxDz() );
461  angleY = atan( TM->localDyDz() );
462 
463  xglob = TM->globalX();
464  yglob = TM->globalY();
465  zglob = TM->globalZ();
466  withinAcceptance = TM->withinAcceptance();
467 
468  trajHitValid = TM->validHit();
469 
470  // reget layer from iidd here, to account for TOB 6 and TEC 9 TKlayers being off
471  TKlayers = checkLayer(iidd, tTopo);
472 
473  if ( (layers == TKlayers) || (layers == 0) ) { // Look at the layer not used to reconstruct the track
474  whatlayer = TKlayers;
475  if (DEBUG) cout << "Looking at layer under study" << endl;
476  TrajGlbX = 0.0; TrajGlbY = 0.0; TrajGlbZ = 0.0; ModIsBad = 2; Id = 0; SiStripQualBad = 0;
477  run = 0; event = 0; TrajLocX = 0.0; TrajLocY = 0.0; TrajLocErrX = 0.0; TrajLocErrY = 0.0;
478  TrajLocAngleX = -999.0; TrajLocAngleY = -999.0; ResX = 0.0; ResXSig = 0.0;
479  ClusterLocX = 0.0; ClusterLocY = 0.0; ClusterLocErrX = 0.0; ClusterLocErrY = 0.0; ClusterStoN = 0.0;
480  bunchx = 0;
481 
482  // RPhi RecHit Efficiency
483 
484  if (input.size() > 0 ) {
485  if (DEBUG) cout << "Checking clusters with size = " << input.size() << endl;
486  int nClusters = 0;
487  std::vector< std::vector<float> > VCluster_info; //fill with X residual, X residual pull, local X, sig(X), local Y, sig(Y), StoN
488  for (edmNew::DetSetVector<SiStripCluster>::const_iterator DSViter = input.begin(); DSViter != input.end(); DSViter++) {
489  // DSViter is a vector of SiStripClusters located on a single module
490  //if (DEBUG) cout << "the ID from the DSViter = " << DSViter->id() << endl;
491  unsigned int ClusterId = DSViter->id();
492  if (ClusterId == iidd) {
493  if (DEBUG) cout << "found (ClusterId == iidd) with ClusterId = " << ClusterId << " and iidd = " << iidd << endl;
494  DetId ClusterDetId(ClusterId);
495  const StripGeomDetUnit * stripdet=(const StripGeomDetUnit*)tkgeom->idToDetUnit(ClusterDetId);
496 
497  for(edmNew::DetSet<SiStripCluster>::const_iterator iter=DSViter->begin();iter!=DSViter->end();++iter) {
498  //iter is a single SiStripCluster
499  StripClusterParameterEstimator::LocalValues parameters=stripcpe.localParameters(*iter,*stripdet);
500  float res = (parameters.first.x() - xloc);
501  float sigma = checkConsistency(parameters , xloc, xErr);
502  // The consistency is probably more accurately measured with the Chi2MeasurementEstimator. To use it
503  // you need a TransientTrackingRecHit instead of the cluster
504  //theEstimator= new Chi2MeasurementEstimator(30);
505  //const Chi2MeasurementEstimator *theEstimator(100);
506  //theEstimator->estimate(TM->tsos(), TransientTrackingRecHit);
507 
508  SiStripClusterInfo clusterInfo = SiStripClusterInfo(*iter, es, ClusterId);
509  // signal to noise from SiStripClusterInfo not working in 225. I'll fix this after the interface
510  // redesign in 300 -ku
511  //float cluster_info[7] = {res, sigma, parameters.first.x(), sqrt(parameters.second.xx()), parameters.first.y(), sqrt(parameters.second.yy()), signal_to_noise};
512  std::vector< float > cluster_info;
513  cluster_info.push_back(res);
514  cluster_info.push_back(sigma);
515  cluster_info.push_back(parameters.first.x());
516  cluster_info.push_back(sqrt(parameters.second.xx()));
517  cluster_info.push_back(parameters.first.y());
518  cluster_info.push_back(sqrt(parameters.second.yy()));
519  cluster_info.push_back( clusterInfo.signalOverNoise() );
520  //cluster_info.push_back( clusterInfo.getSignalOverNoise() );
521  VCluster_info.push_back(cluster_info);
522  nClusters++;
523  if (DEBUG) cout << "Have ID match. residual = " << VCluster_info.back()[0] << " res sigma = " << VCluster_info.back()[1] << endl;
524  if (DEBUG) cout << "trajectory measurement compatability estimate = " << (*itm).estimate() << endl;
525  if (DEBUG) cout << "hit position = " << parameters.first.x() << " hit error = " << sqrt(parameters.second.xx()) << " trajectory position = " << xloc << " traj error = " << xErr << endl;
526  }
527  }
528  }
529  float FinalResSig = 1000.0;
530  float FinalCluster[7]= {1000.0, 1000.0, 0.0, 0.0, 0.0, 0.0, 0.0};
531  if (nClusters > 0) {
532  if (DEBUG) cout << "found clusters > 0" << endl;
533  if (nClusters > 1) {
534  //get the smallest one
535  vector< vector<float> >::iterator ires;
536  for (ires=VCluster_info.begin(); ires!=VCluster_info.end(); ires++){
537  if ( abs((*ires)[1]) < abs(FinalResSig)) {
538  FinalResSig = (*ires)[1];
539  for (unsigned int i = 0; i<ires->size(); i++) {
540  if (DEBUG) cout << "filling final cluster. i = " << i << " before fill FinalCluster[i]=" << FinalCluster[i] << " and (*ires)[i] =" << (*ires)[i] << endl;
541  FinalCluster[i] = (*ires)[i];
542  if (DEBUG) cout << "filling final cluster. i = " << i << " after fill FinalCluster[i]=" << FinalCluster[i] << " and (*ires)[i] =" << (*ires)[i] << endl;
543  }
544  }
545  if (DEBUG) cout << "iresidual = " << (*ires)[0] << " isigma = " << (*ires)[1] << " and FinalRes = " << FinalCluster[0] << endl;
546  }
547  }
548  else {
549  FinalResSig = VCluster_info.at(0)[1];
550  for (unsigned int i = 0; i<VCluster_info.at(0).size(); i++) {
551  FinalCluster[i] = VCluster_info.at(0)[i];
552  }
553  }
554  nClusters=0;
555  VCluster_info.clear();
556  }
557 
558  if (DEBUG) cout << "Final residual in X = " << FinalCluster[0] << "+-" << (FinalCluster[0]/FinalResSig) << endl;
559  if (DEBUG) cout << "Checking location of trajectory: abs(yloc) = " << abs(yloc) << " abs(xloc) = " << abs(xloc) << endl;
560  if (DEBUG) cout << "Checking location of cluster hit: yloc = " << FinalCluster[4] << "+-" << FinalCluster[5] << " xloc = " << FinalCluster[2] << "+-" << FinalCluster[3] << endl;
561  if (DEBUG) cout << "Final cluster signal to noise = " << FinalCluster[6] << endl;
562 
563  float exclusionWidth = 0.4;
564  float TOBexclusion = 0.0;
565  float TECexRing5 = -0.89;
566  float TECexRing6 = -0.56;
567  float TECexRing7 = 0.60;
568  //Added by Chris Edelmaier to do TEC bonding exclusion
569  int subdetector = ((iidd>>25) & 0x7);
570  int ringnumber = ((iidd>>5) & 0x7);
571 
572  //New TOB and TEC bonding region exclusion zone
573  if((TKlayers >= 5 && TKlayers < 11)||((subdetector == 6)&&( (ringnumber >= 5)&&(ringnumber <=7) ))) {
574  //There are only 2 cases that we need to exclude for
575  float highzone = 0.0;
576  float lowzone = 0.0;
577  float higherr = yloc + 5.0*yErr;
578  float lowerr = yloc - 5.0*yErr;
579  if(TKlayers >= 5 && TKlayers < 11) {
580  //TOB zone
581  highzone = TOBexclusion + exclusionWidth;
582  lowzone = TOBexclusion - exclusionWidth;
583  } else if (ringnumber == 5) {
584  //TEC ring 5
585  highzone = TECexRing5 + exclusionWidth;
586  lowzone = TECexRing5 - exclusionWidth;
587  } else if (ringnumber == 6) {
588  //TEC ring 6
589  highzone = TECexRing6 + exclusionWidth;
590  lowzone = TECexRing6 - exclusionWidth;
591  } else if (ringnumber == 7) {
592  //TEC ring 7
593  highzone = TECexRing7 + exclusionWidth;
594  lowzone = TECexRing7 - exclusionWidth;
595  }
596  //Now that we have our exclusion region, we just have to properly identify it
597  if((highzone <= higherr)&&(highzone >= lowerr)) withinAcceptance = false;
598  if((lowzone >= lowerr)&&(lowzone <= higherr)) withinAcceptance = false;
599  if((higherr <= highzone)&&(higherr >= lowzone)) withinAcceptance = false;
600  if((lowerr >= lowzone)&&(lowerr <= highzone)) withinAcceptance = false;
601  }
602 
603  // fill ntuple varibles
604  //get global position from module id number iidd
605  TrajGlbX = xglob;
606  TrajGlbY = yglob;
607  TrajGlbZ = zglob;
608  Id = iidd;
609  run = run_nr;
610  event = ev_nr;
611  bunchx = bunch_nr;
612  //if ( SiStripQuality_->IsModuleBad(iidd) ) {
613  if ( SiStripQuality_->getBadApvs(iidd)!=0 ) {
614  SiStripQualBad = 1;
615  if(DEBUG) cout << "strip is bad from SiStripQuality" << endl;
616  } else {
617  SiStripQualBad = 0;
618  if(DEBUG) cout << "strip is good from SiStripQuality" << endl;
619  }
620 
621  //check for FED-detected errors and include those in SiStripQualBad
622  for (unsigned int ii=0;ii< fedErrorIds->size();ii++) {
623  if (iidd == (*fedErrorIds)[ii].rawId() )
624  SiStripQualBad = 1;
625  }
626 
627  TrajLocX = xloc;
628  TrajLocY = yloc;
629  TrajLocErrX = xErr;
630  TrajLocErrY = yErr;
631  TrajLocAngleX = angleX;
632  TrajLocAngleY = angleY;
633  ResX = FinalCluster[0];
634  ResXSig = FinalResSig;
635  if (FinalResSig != FinalCluster[1]) if (DEBUG) cout << "Problem with best cluster selection because FinalResSig = " << FinalResSig << " and FinalCluster[1] = " << FinalCluster[1] << endl;
636  ClusterLocX = FinalCluster[2];
637  ClusterLocY = FinalCluster[4];
638  ClusterLocErrX = FinalCluster[3];
639  ClusterLocErrY = FinalCluster[5];
640  ClusterStoN = FinalCluster[6];
641 
642  if (DEBUG) cout << "before check good" << endl;
643 
644  if ( FinalResSig < 999.0) { //could make requirement on track/hit consistency, but for
645  //now take anything with a hit on the module
646  if (DEBUG) cout << "hit being counted as good " << FinalCluster[0] << " FinalRecHit " <<
647  iidd << " TKlayers " << TKlayers << " xloc " << xloc << " yloc " << yloc << " module " << iidd <<
648  " matched/stereo/rphi = " << ((iidd & 0x3)==0) << "/" << ((iidd & 0x3)==1) << "/" << ((iidd & 0x3)==2) << endl;
649  ModIsBad = 0;
650  traj->Fill();
651  }
652  else {
653  if (DEBUG) cout << "hit being counted as bad ######### Invalid RPhi FinalResX " << FinalCluster[0] << " FinalRecHit " <<
654  iidd << " TKlayers " << TKlayers << " xloc " << xloc << " yloc " << yloc << " module " << iidd <<
655  " matched/stereo/rphi = " << ((iidd & 0x3)==0) << "/" << ((iidd & 0x3)==1) << "/" << ((iidd & 0x3)==2) << endl;
656  ModIsBad = 1;
657  traj->Fill();
658 
659  if (DEBUG) cout << " RPhi Error " << sqrt(xErr*xErr + yErr*yErr) << " ErrorX " << xErr << " yErr " << yErr << endl;
660  } if (DEBUG) cout << "after good location check" << endl;
661  } if (DEBUG) cout << "after list of clusters" << endl;
662  } if (DEBUG) cout << "After layers=TKLayers if" << endl;
663  } if (DEBUG) cout << "After looping over TrajAtValidHit list" << endl;
664  } if (DEBUG) cout << "end TMeasurement loop" << endl;
665  } if (DEBUG) cout << "end of trajectories loop" << endl;
666  }
667 }
RunNumber_t run() const
Definition: EventID.h:42
T getParameter(std::string const &) const
EventNumber_t event() const
Definition: EventID.h:44
std::vector< TrajectoryMeasurement > measurements(const DetLayer &layer, const TrajectoryStateOnSurface &startingState, const Propagator &prop, const MeasurementEstimator &est) const
int i
Definition: DBlmapReader.cc:9
float TrajGlbZ
Definition: HitEff.h:71
dictionary parameters
Definition: Parameters.py:2
bool check2DPartner(unsigned int iidd, const std::vector< TrajectoryMeasurement > &traj)
Definition: HitEff.cc:716
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
float ClusterLocErrX
Definition: HitEff.h:73
float ClusterLocErrY
Definition: HitEff.h:73
float TrajGlbY
Definition: HitEff.h:71
float TrajLocX
Definition: HitEff.h:72
float ResXSig
Definition: HitEff.h:74
float chi2
Definition: HitEff.h:77
int ires[2]
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
int bunchCrossing() const
Definition: EventBase.h:62
#define abs(x)
Definition: mlp_lapack.h:159
float ClusterStoN
Definition: HitEff.h:73
data_type const * const_iterator
Definition: DetSetNew.h:25
float TrajLocErrX
Definition: HitEff.h:72
int ii
Definition: cuy.py:588
std::pair< LocalPoint, LocalError > LocalValues
std::vector< Muon > MuonCollection
collection of Muon objects
Definition: MuonFwd.h:9
bool DEBUG
Definition: HitEff.h:66
unsigned int bunchx
Definition: HitEff.h:78
float p
Definition: HitEff.h:77
float timeECAL
Definition: HitEff.h:81
float signalOverNoise() const
bool isDoubleSided(unsigned int iidd, const TrackerTopology *tTopo) const
Definition: HitEff.cc:684
float timeDTErr
Definition: HitEff.h:79
int nHits
Definition: HitEff.h:76
unsigned int Id
Definition: HitEff.h:75
T sqrt(T t)
Definition: SSEVec.h:48
int timeDTDOF
Definition: HitEff.h:80
float timeAtIpInOutErr
Definition: MuonTime.h:15
int nDof
number of muon stations used
Definition: MuonTime.h:10
unsigned int trajHitValid
Definition: HitEff.h:78
unsigned int ModIsBad
Definition: HitEff.h:75
float TrajGlbX
Definition: HitEff.h:71
bool withinAcceptance
Definition: HitEff.h:75
unsigned int run
Definition: HitEff.h:78
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
float ClusterLocX
Definition: HitEff.h:73
int events
Definition: HitEff.h:63
float TrajLocAngleX
Definition: HitEff.h:72
Definition: DetId.h:20
double checkConsistency(const StripClusterParameterEstimator::LocalValues &parameters, double xx, double xerr)
Definition: HitEff.cc:677
unsigned int whatlayer
Definition: HitEff.h:67
unsigned int checkLayer(unsigned int iidd, const TrackerTopology *tTopo)
Definition: HitEff.cc:732
T const * product() const
Definition: ESHandle.h:62
float timeDT
Definition: HitEff.h:79
unsigned int layers
Definition: HitEff.h:65
float pT
Definition: HitEff.h:77
T const * product() const
Definition: Handle.h:74
float ResX
Definition: HitEff.h:74
unsigned int SiStripQualBad
Definition: HitEff.h:75
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
edm::EventID id() const
Definition: EventBase.h:56
float TrajLocErrY
Definition: HitEff.h:72
float TrajLocAngleY
Definition: HitEff.h:72
tuple cout
Definition: gather_cfg.py:121
float ClusterLocY
Definition: HitEff.h:73
TTree * traj
Definition: HitEff.h:62
edm::ParameterSet conf_
Definition: HitEff.h:60
float timeAtIpInOut
Definition: MuonTime.h:14
int EventTrackCKF
Definition: HitEff.h:63
int nLostHits
Definition: HitEff.h:76
float TrajLocY
Definition: HitEff.h:72
unsigned int tecSide(const DetId &id) const
void HitEff::beginJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 82 of file HitEff.cc.

References bunchx, chi2, ClusterLocErrX, ClusterLocErrY, ClusterLocX, ClusterLocY, ClusterStoN, dedx, dedxNOM, event, events, EventTrackCKF, Id, istep, TFileDirectory::make(), ModIsBad, nHits, nLostHits, p, pT, ResX, ResXSig, run, SiStripQualBad, timeDT, timeDTDOF, timeDTErr, timeECAL, tquality, traj, TrajGlbX, TrajGlbY, TrajGlbZ, trajHitValid, TrajLocAngleX, TrajLocAngleY, TrajLocErrX, TrajLocErrY, TrajLocX, TrajLocY, whatlayer, and withinAcceptance.

82  {
83 
85 
86  traj = fs->make<TTree>("traj","tree of trajectory positions");
87  traj->Branch("TrajGlbX",&TrajGlbX,"TrajGlbX/F");
88  traj->Branch("TrajGlbY",&TrajGlbY,"TrajGlbY/F");
89  traj->Branch("TrajGlbZ",&TrajGlbZ,"TrajGlbZ/F");
90  traj->Branch("TrajLocX",&TrajLocX,"TrajLocX/F");
91  traj->Branch("TrajLocY",&TrajLocY,"TrajLocY/F");
92  traj->Branch("TrajLocErrX",&TrajLocErrX,"TrajLocErrX/F");
93  traj->Branch("TrajLocErrY",&TrajLocErrY,"TrajLocErrY/F");
94  traj->Branch("TrajLocAngleX",&TrajLocAngleX,"TrajLocAngleX/F");
95  traj->Branch("TrajLocAngleY",&TrajLocAngleY,"TrajLocAngleY/F");
96  traj->Branch("ClusterLocX",&ClusterLocX,"ClusterLocX/F");
97  traj->Branch("ClusterLocY",&ClusterLocY,"ClusterLocY/F");
98  traj->Branch("ClusterLocErrX",&ClusterLocErrX,"ClusterLocErrX/F");
99  traj->Branch("ClusterLocErrY",&ClusterLocErrY,"ClusterLocErrY/F");
100  traj->Branch("ClusterStoN",&ClusterStoN,"ClusterStoN/F");
101  traj->Branch("ResX",&ResX,"ResX/F");
102  traj->Branch("ResXSig",&ResXSig,"ResXSig/F");
103  traj->Branch("ModIsBad",&ModIsBad,"ModIsBad/i");
104  traj->Branch("SiStripQualBad",&SiStripQualBad,"SiStripQualBad/i");
105  traj->Branch("withinAcceptance",&withinAcceptance,"withinAcceptance/O");
106  traj->Branch("nHits",&nHits,"nHits/I");
107  traj->Branch("nLostHits",&nLostHits,"nLostHits/I");
108  traj->Branch("chi2",&chi2,"chi2/F");
109  traj->Branch("p",&p,"p/F");
110  traj->Branch("pT",&pT,"pT/F");
111  traj->Branch("trajHitValid", &trajHitValid, "trajHitValid/i");
112  traj->Branch("Id",&Id,"Id/i");
113  traj->Branch("run",&run,"run/i");
114  traj->Branch("event",&event,"event/i");
115  traj->Branch("layer",&whatlayer,"layer/i");
116  traj->Branch("timeDT",&timeDT,"timeDT/F");
117  traj->Branch("timeDTErr",&timeDTErr,"timeDTErr/F");
118  traj->Branch("timeDTDOF",&timeDTDOF,"timeDTDOF/I");
119  traj->Branch("timeECAL",&timeECAL,"timeECAL/F");
120  traj->Branch("dedx",&dedx,"dedx/F");
121  traj->Branch("dedxNOM",&dedxNOM,"dedxNOM/I");
122  traj->Branch("tquality",&tquality,"tquality/I");
123  traj->Branch("istep",&istep,"istep/I");
124  traj->Branch("bunchx",&bunchx,"bunchx/I");
125 
126  events = 0;
127  EventTrackCKF = 0;
128 
129 }
float TrajGlbZ
Definition: HitEff.h:71
float ClusterLocErrX
Definition: HitEff.h:73
float ClusterLocErrY
Definition: HitEff.h:73
float TrajGlbY
Definition: HitEff.h:71
float TrajLocX
Definition: HitEff.h:72
float ResXSig
Definition: HitEff.h:74
float chi2
Definition: HitEff.h:77
float ClusterStoN
Definition: HitEff.h:73
float TrajLocErrX
Definition: HitEff.h:72
unsigned int bunchx
Definition: HitEff.h:78
float p
Definition: HitEff.h:77
float timeECAL
Definition: HitEff.h:81
float timeDTErr
Definition: HitEff.h:79
int nHits
Definition: HitEff.h:76
unsigned int Id
Definition: HitEff.h:75
int timeDTDOF
Definition: HitEff.h:80
unsigned int trajHitValid
Definition: HitEff.h:78
unsigned int ModIsBad
Definition: HitEff.h:75
int istep
Definition: HitEff.h:84
float TrajGlbX
Definition: HitEff.h:71
bool withinAcceptance
Definition: HitEff.h:75
unsigned int run
Definition: HitEff.h:78
float ClusterLocX
Definition: HitEff.h:73
int events
Definition: HitEff.h:63
float TrajLocAngleX
Definition: HitEff.h:72
int dedxNOM
Definition: HitEff.h:82
unsigned int event
Definition: HitEff.h:78
unsigned int whatlayer
Definition: HitEff.h:67
float timeDT
Definition: HitEff.h:79
float pT
Definition: HitEff.h:77
float ResX
Definition: HitEff.h:74
unsigned int SiStripQualBad
Definition: HitEff.h:75
float TrajLocErrY
Definition: HitEff.h:72
float TrajLocAngleY
Definition: HitEff.h:72
T * make() const
make new ROOT object
float dedx
Definition: HitEff.h:81
float ClusterLocY
Definition: HitEff.h:73
TTree * traj
Definition: HitEff.h:62
int EventTrackCKF
Definition: HitEff.h:63
int nLostHits
Definition: HitEff.h:76
float TrajLocY
Definition: HitEff.h:72
int tquality
Definition: HitEff.h:83
bool HitEff::check2DPartner ( unsigned int  iidd,
const std::vector< TrajectoryMeasurement > &  traj 
)

Definition at line 716 of file HitEff.cc.

Referenced by analyze().

716  {
717  unsigned int partner_iidd = 0;
718  bool found2DPartner = false;
719  // first get the id of the other detector
720  if ((iidd & 0x3)==1) partner_iidd = iidd+1;
721  if ((iidd & 0x3)==2) partner_iidd = iidd-1;
722  // next look in the trajectory measurements for a measurement from that detector
723  // loop through trajectory measurements to find the partner_iidd
724  for (std::vector<TrajectoryMeasurement>::const_iterator iTM=traj.begin(); iTM!=traj.end(); ++iTM) {
725  if (iTM->recHit()->geographicalId().rawId()==partner_iidd) {
726  found2DPartner = true;
727  }
728  }
729  return found2DPartner;
730 }
TTree * traj
Definition: HitEff.h:62
double HitEff::checkConsistency ( const StripClusterParameterEstimator::LocalValues parameters,
double  xx,
double  xerr 
)

Definition at line 677 of file HitEff.cc.

References abs, error, and mathSSE::sqrt().

Referenced by analyze().

677  {
678  double error = sqrt(parameters.second.xx() + xerr*xerr);
679  double separation = abs(parameters.first.x() - xx);
680  double consistency = separation/error;
681  return consistency;
682 }
dictionary parameters
Definition: Parameters.py:2
#define abs(x)
Definition: mlp_lapack.h:159
T sqrt(T t)
Definition: SSEVec.h:48
unsigned int HitEff::checkLayer ( unsigned int  iidd,
const TrackerTopology tTopo 
)

Definition at line 732 of file HitEff.cc.

References DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecWheel(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidWheel(), StripSubdetector::TOB, and TrackerTopology::tobLayer().

Referenced by analyze().

732  {
734  unsigned int subid=strip.subdetId();
735  if (subid == StripSubdetector::TIB) {
736 
737  return tTopo->tibLayer(iidd);
738  }
739  if (subid == StripSubdetector::TOB) {
740 
741  return tTopo->tobLayer(iidd) + 4 ;
742  }
743  if (subid == StripSubdetector::TID) {
744 
745  return tTopo->tidWheel(iidd) + 10;
746  }
747  if (subid == StripSubdetector::TEC) {
748 
749  return tTopo->tecWheel(iidd) + 13 ;
750  }
751  return 0;
752 }
unsigned int tibLayer(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
unsigned int tecWheel(const DetId &id) const
unsigned int tobLayer(const DetId &id) const
void HitEff::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 669 of file HitEff.cc.

References gather_cfg::cout, DEBUG, events, EventTrackCKF, and traj.

669  {
670  traj->GetDirectory()->cd();
671  traj->Write();
672 
673  if (DEBUG) cout << " Events Analysed " << events << endl;
674  if (DEBUG) cout << " Number Of Tracked events " << EventTrackCKF << endl;
675 }
bool DEBUG
Definition: HitEff.h:66
int events
Definition: HitEff.h:63
tuple cout
Definition: gather_cfg.py:121
TTree * traj
Definition: HitEff.h:62
int EventTrackCKF
Definition: HitEff.h:63
bool HitEff::isDoubleSided ( unsigned int  iidd,
const TrackerTopology tTopo 
) const

Definition at line 684 of file HitEff.cc.

References DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecRing(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidRing(), StripSubdetector::TOB, and TrackerTopology::tobLayer().

Referenced by analyze().

684  {
686  unsigned int subid=strip.subdetId();
687  unsigned int layer = 0;
688  if (subid == StripSubdetector::TIB) {
689 
690  layer = tTopo->tibLayer(iidd);
691  if (layer == 1 || layer == 2) return true;
692  else return false;
693  }
694  else if (subid == StripSubdetector::TOB) {
695 
696  layer = tTopo->tobLayer(iidd) + 4 ;
697  if (layer == 5 || layer == 6) return true;
698  else return false;
699  }
700  else if (subid == StripSubdetector::TID) {
701 
702  layer = tTopo->tidRing(iidd) + 10;
703  if (layer == 11 || layer == 12) return true;
704  else return false;
705  }
706  else if (subid == StripSubdetector::TEC) {
707 
708  layer = tTopo->tecRing(iidd) + 13 ;
709  if (layer == 14 || layer == 15 || layer == 18) return true;
710  else return false;
711  }
712  else
713  return false;
714 }
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
unsigned int tobLayer(const DetId &id) const

Member Data Documentation

unsigned int HitEff::bunchx
private

Definition at line 78 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::chi2
private

Definition at line 77 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ClusterLocErrX
private

Definition at line 73 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ClusterLocErrY
private

Definition at line 73 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ClusterLocX
private

Definition at line 73 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ClusterLocY
private

Definition at line 73 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ClusterStoN
private

Definition at line 73 of file HitEff.h.

Referenced by analyze(), and beginJob().

edm::ParameterSet HitEff::conf_
private

Definition at line 60 of file HitEff.h.

Referenced by analyze(), and HitEff().

bool HitEff::DEBUG
private

Definition at line 66 of file HitEff.h.

Referenced by analyze(), endJob(), and HitEff().

float HitEff::dedx
private

Definition at line 81 of file HitEff.h.

Referenced by beginJob().

int HitEff::dedxNOM
private

Definition at line 82 of file HitEff.h.

Referenced by beginJob().

unsigned int HitEff::event
private

Definition at line 78 of file HitEff.h.

Referenced by beginJob(), and Types.EventID::cppID().

int HitEff::events
private

Definition at line 63 of file HitEff.h.

Referenced by analyze(), beginJob(), and endJob().

int HitEff::EventTrackCKF
private

Definition at line 63 of file HitEff.h.

Referenced by analyze(), beginJob(), and endJob().

unsigned int HitEff::Id
private

Definition at line 75 of file HitEff.h.

Referenced by analyze(), and beginJob().

int HitEff::istep
private

Definition at line 84 of file HitEff.h.

Referenced by beginJob().

unsigned int HitEff::layers
private

Definition at line 65 of file HitEff.h.

Referenced by analyze(), and HitEff().

unsigned int HitEff::ModIsBad
private

Definition at line 75 of file HitEff.h.

Referenced by analyze(), and beginJob().

int HitEff::nHits
private

Definition at line 76 of file HitEff.h.

Referenced by analyze(), and beginJob().

int HitEff::nLostHits
private

Definition at line 76 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::p
private
float HitEff::pT
private

Definition at line 77 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ResX
private

Definition at line 74 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ResXSig
private

Definition at line 74 of file HitEff.h.

Referenced by analyze(), and beginJob().

unsigned int HitEff::run
private
unsigned int HitEff::SiStripQualBad
private

Definition at line 75 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::timeDT
private

Definition at line 79 of file HitEff.h.

Referenced by analyze(), and beginJob().

int HitEff::timeDTDOF
private

Definition at line 80 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::timeDTErr
private

Definition at line 79 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::timeECAL
private

Definition at line 81 of file HitEff.h.

Referenced by analyze(), and beginJob().

int HitEff::tquality
private

Definition at line 83 of file HitEff.h.

Referenced by beginJob().

TTree* HitEff::traj
private

Definition at line 62 of file HitEff.h.

Referenced by analyze(), beginJob(), and endJob().

float HitEff::TrajGlbX
private

Definition at line 71 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajGlbY
private

Definition at line 71 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajGlbZ
private

Definition at line 71 of file HitEff.h.

Referenced by analyze(), and beginJob().

unsigned int HitEff::trajHitValid
private

Definition at line 78 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajLocAngleX
private

Definition at line 72 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajLocAngleY
private

Definition at line 72 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajLocErrX
private

Definition at line 72 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajLocErrY
private

Definition at line 72 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajLocX
private

Definition at line 72 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajLocY
private

Definition at line 72 of file HitEff.h.

Referenced by analyze(), and beginJob().

unsigned int HitEff::whatlayer
private

Definition at line 67 of file HitEff.h.

Referenced by analyze(), and beginJob().

bool HitEff::withinAcceptance
private

Definition at line 75 of file HitEff.h.

Referenced by analyze(), and beginJob().