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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) 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
 
const edm::EDGetTokenT
< edmNew::DetSetVector
< SiStripCluster > > 
clusters_token_
 
float ClusterStoN
 
const edm::EDGetTokenT
< reco::TrackCollection
combinatorialTracks_token_
 
edm::ParameterSet conf_
 
bool DEBUG
 
float dedx
 
int dedxNOM
 
const edm::EDGetTokenT
< DetIdCollection
digis_token_
 
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
 
const edm::EDGetTokenT
< MeasurementTrackerEvent
trackerEvent_token_
 
TTree * traj
 
const edm::EDGetTokenT
< std::vector< Trajectory > > 
trajectories_token_
 
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
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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::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 45 of file HitEff.h.

Constructor & Destructor Documentation

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

Definition at line 74 of file HitEff.cc.

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

74  :
75  combinatorialTracks_token_( consumes< reco::TrackCollection >(conf.getParameter<edm::InputTag>("combinatorialTracks")) ),
76  trajectories_token_( consumes< std::vector<Trajectory> >(conf.getParameter<edm::InputTag>("trajectories")) ),
78  digis_token_( consumes< DetIdCollection >(conf.getParameter<edm::InputTag>("siStripDigis")) ),
79  trackerEvent_token_( consumes< MeasurementTrackerEvent>(conf.getParameter<edm::InputTag>("trackerEvent")) ),
80  conf_(conf)
81 {
82  layers =conf_.getParameter<int>("Layer");
83  DEBUG = conf_.getParameter<bool>("Debug");
84 }
T getParameter(std::string const &) const
bool DEBUG
Definition: HitEff.h:73
const edm::EDGetTokenT< MeasurementTrackerEvent > trackerEvent_token_
Definition: HitEff.h:65
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< DetIdCollection > digis_token_
Definition: HitEff.h:64
unsigned int layers
Definition: HitEff.h:72
const edm::EDGetTokenT< reco::TrackCollection > combinatorialTracks_token_
Definition: HitEff.h:61
const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusters_token_
Definition: HitEff.h:63
const edm::EDGetTokenT< std::vector< Trajectory > > trajectories_token_
Definition: HitEff.h:62
edm::ParameterSet conf_
Definition: HitEff.h:67
HitEff::~HitEff ( )
virtual

Definition at line 87 of file HitEff.cc.

87 { }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 139 of file HitEff.cc.

References funct::abs(), AnalyticalPropagator_cfi::AnalyticalPropagator, anyDirection, edm::EventBase::bunchCrossing(), bunchx, check2DPartner(), checkConsistency(), checkLayer(), chi2, ClusterLocErrX, ClusterLocErrY, ClusterLocX, ClusterLocY, clusters_token_, ClusterStoN, combinatorialTracks_token_, gather_cfg::cout, DEBUG, digis_token_, HLT_25ns10e33_v2_cff::estimator, edm::EventID::event(), events, EventTrackCKF, edm::EventSetup::get(), edm::Event::getByLabel(), edm::Event::getByToken(), i, edm::EventBase::id(), Id, cuy::ii, input, ires, isDoubleSided(), layers, StripClusterParameterEstimator::localParameters(), LayerMeasurements::measurements(), ModIsBad, reco::MuonTime::nDof, nHits, nLostHits, p, TrapezoidalPlaneBounds::parameters(), HLT_25ns10e33_v2_cff::parameters, edm::Handle< T >::product(), edm::ESHandle< class >::product(), HLT_25ns10e33_v2_cff::propagator, pT, TrajectoryMeasurement::recHit(), dt_dqm_sourceclient_common_cff::reco, ResX, ResXSig, edm::EventID::run(), run, SiStripClusterInfo::signalOverNoise(), SiStripQualBad, mathSSE::sqrt(), subdetector, GeomDet::surface(), StripSubdetector::TEC, TrackerTopology::tecSide(), reco::MuonTime::timeAtIpInOut, reco::MuonTime::timeAtIpInOutErr, timeDT, timeDTDOF, timeDTErr, timeECAL, tmp, patCandidatesForDimuonsSequences_cff::tracker, trackerEvent_token_, traj, trajectories_token_, TrajGlbX, TrajGlbY, TrajGlbZ, trajHitValid, TrajLocAngleX, TrajLocAngleY, TrajLocErrX, TrajLocErrY, TrajLocX, TrajLocY, whatlayer, and withinAcceptance.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 89 of file HitEff.cc.

References bunchx, chi2, ClusterLocErrX, ClusterLocErrY, ClusterLocX, ClusterLocY, ClusterStoN, dedx, dedxNOM, event, events, EventTrackCKF, Id, istep, TFileService::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.

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

Definition at line 748 of file HitEff.cc.

Referenced by analyze().

748  {
749  unsigned int partner_iidd = 0;
750  bool found2DPartner = false;
751  // first get the id of the other detector
752  if ((iidd & 0x3)==1) partner_iidd = iidd+1;
753  if ((iidd & 0x3)==2) partner_iidd = iidd-1;
754  // next look in the trajectory measurements for a measurement from that detector
755  // loop through trajectory measurements to find the partner_iidd
756  for (std::vector<TrajectoryMeasurement>::const_iterator iTM=traj.begin(); iTM!=traj.end(); ++iTM) {
757  if (iTM->recHit()->geographicalId().rawId()==partner_iidd) {
758  found2DPartner = true;
759  }
760  }
761  return found2DPartner;
762 }
TTree * traj
Definition: HitEff.h:69
double HitEff::checkConsistency ( const StripClusterParameterEstimator::LocalValues parameters,
double  xx,
double  xerr 
)

Definition at line 709 of file HitEff.cc.

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

Referenced by analyze().

709  {
710  double error = sqrt(parameters.second.xx() + xerr*xerr);
711  double separation = abs(parameters.first.x() - xx);
712  double consistency = separation/error;
713  return consistency;
714 }
T sqrt(T t)
Definition: SSEVec.h:18
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
unsigned int HitEff::checkLayer ( unsigned int  iidd,
const TrackerTopology tTopo 
)

Definition at line 764 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().

764  {
766  unsigned int subid=strip.subdetId();
767  if (subid == StripSubdetector::TIB) {
768 
769  return tTopo->tibLayer(iidd);
770  }
771  if (subid == StripSubdetector::TOB) {
772 
773  return tTopo->tobLayer(iidd) + 4 ;
774  }
775  if (subid == StripSubdetector::TID) {
776 
777  return tTopo->tidWheel(iidd) + 10;
778  }
779  if (subid == StripSubdetector::TEC) {
780 
781  return tTopo->tecWheel(iidd) + 13 ;
782  }
783  return 0;
784 }
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:37
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 701 of file HitEff.cc.

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

Referenced by o2o.O2ORunMgr::executeJob().

701  {
702  traj->GetDirectory()->cd();
703  traj->Write();
704 
705  if (DEBUG) cout << " Events Analysed " << events << endl;
706  if (DEBUG) cout << " Number Of Tracked events " << EventTrackCKF << endl;
707 }
bool DEBUG
Definition: HitEff.h:73
int events
Definition: HitEff.h:70
tuple cout
Definition: gather_cfg.py:145
TTree * traj
Definition: HitEff.h:69
int EventTrackCKF
Definition: HitEff.h:70
bool HitEff::isDoubleSided ( unsigned int  iidd,
const TrackerTopology tTopo 
) const

Definition at line 716 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().

716  {
718  unsigned int subid=strip.subdetId();
719  unsigned int layer = 0;
720  if (subid == StripSubdetector::TIB) {
721 
722  layer = tTopo->tibLayer(iidd);
723  if (layer == 1 || layer == 2) return true;
724  else return false;
725  }
726  else if (subid == StripSubdetector::TOB) {
727 
728  layer = tTopo->tobLayer(iidd) + 4 ;
729  if (layer == 5 || layer == 6) return true;
730  else return false;
731  }
732  else if (subid == StripSubdetector::TID) {
733 
734  layer = tTopo->tidRing(iidd) + 10;
735  if (layer == 11 || layer == 12) return true;
736  else return false;
737  }
738  else if (subid == StripSubdetector::TEC) {
739 
740  layer = tTopo->tecRing(iidd) + 13 ;
741  if (layer == 14 || layer == 15 || layer == 18) return true;
742  else return false;
743  }
744  else
745  return false;
746 }
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:37
unsigned int tobLayer(const DetId &id) const

Member Data Documentation

unsigned int HitEff::bunchx
private

Definition at line 85 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::chi2
private

Definition at line 84 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ClusterLocErrX
private

Definition at line 80 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ClusterLocErrY
private

Definition at line 80 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ClusterLocX
private

Definition at line 80 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ClusterLocY
private

Definition at line 80 of file HitEff.h.

Referenced by analyze(), and beginJob().

const edm::EDGetTokenT< edmNew::DetSetVector<SiStripCluster> > HitEff::clusters_token_
private

Definition at line 63 of file HitEff.h.

Referenced by analyze().

float HitEff::ClusterStoN
private

Definition at line 80 of file HitEff.h.

Referenced by analyze(), and beginJob().

const edm::EDGetTokenT< reco::TrackCollection > HitEff::combinatorialTracks_token_
private

Definition at line 61 of file HitEff.h.

Referenced by analyze().

edm::ParameterSet HitEff::conf_
private

Definition at line 67 of file HitEff.h.

Referenced by HitEff().

bool HitEff::DEBUG
private

Definition at line 73 of file HitEff.h.

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

float HitEff::dedx
private

Definition at line 88 of file HitEff.h.

Referenced by beginJob().

int HitEff::dedxNOM
private

Definition at line 89 of file HitEff.h.

Referenced by beginJob().

const edm::EDGetTokenT<DetIdCollection> HitEff::digis_token_
private

Definition at line 64 of file HitEff.h.

Referenced by analyze().

unsigned int HitEff::event
private
int HitEff::events
private
int HitEff::EventTrackCKF
private

Definition at line 70 of file HitEff.h.

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

unsigned int HitEff::Id
private

Definition at line 82 of file HitEff.h.

Referenced by analyze(), and beginJob().

int HitEff::istep
private

Definition at line 91 of file HitEff.h.

Referenced by beginJob().

unsigned int HitEff::layers
private

Definition at line 72 of file HitEff.h.

Referenced by analyze(), and HitEff().

unsigned int HitEff::ModIsBad
private

Definition at line 82 of file HitEff.h.

Referenced by analyze(), and beginJob().

int HitEff::nHits
private

Definition at line 83 of file HitEff.h.

Referenced by analyze(), and beginJob().

int HitEff::nLostHits
private

Definition at line 83 of file HitEff.h.

Referenced by analyze(), and beginJob().

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

Definition at line 84 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ResX
private

Definition at line 81 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::ResXSig
private

Definition at line 81 of file HitEff.h.

Referenced by analyze(), and beginJob().

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

Definition at line 82 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::timeDT
private

Definition at line 86 of file HitEff.h.

Referenced by analyze(), and beginJob().

int HitEff::timeDTDOF
private

Definition at line 87 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::timeDTErr
private

Definition at line 86 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::timeECAL
private

Definition at line 88 of file HitEff.h.

Referenced by analyze(), and beginJob().

int HitEff::tquality
private

Definition at line 90 of file HitEff.h.

Referenced by beginJob().

const edm::EDGetTokenT<MeasurementTrackerEvent> HitEff::trackerEvent_token_
private

Definition at line 65 of file HitEff.h.

Referenced by analyze().

TTree* HitEff::traj
private

Definition at line 69 of file HitEff.h.

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

const edm::EDGetTokenT< std::vector<Trajectory> > HitEff::trajectories_token_
private

Definition at line 62 of file HitEff.h.

Referenced by analyze().

float HitEff::TrajGlbX
private

Definition at line 78 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajGlbY
private

Definition at line 78 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajGlbZ
private

Definition at line 78 of file HitEff.h.

Referenced by analyze(), and beginJob().

unsigned int HitEff::trajHitValid
private

Definition at line 85 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajLocAngleX
private

Definition at line 79 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajLocAngleY
private

Definition at line 79 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajLocErrX
private

Definition at line 79 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajLocErrY
private

Definition at line 79 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajLocX
private

Definition at line 79 of file HitEff.h.

Referenced by analyze(), and beginJob().

float HitEff::TrajLocY
private

Definition at line 79 of file HitEff.h.

Referenced by analyze(), and beginJob().

unsigned int HitEff::whatlayer
private

Definition at line 74 of file HitEff.h.

Referenced by analyze(), and beginJob().

bool HitEff::withinAcceptance
private

Definition at line 82 of file HitEff.h.

Referenced by analyze(), and beginJob().