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
TestHits Class Reference

#include <RecoTracker/DebugTools/src/TestHits.cc>

Inheritance diagram for TestHits:
edm::EDAnalyzer

Public Member Functions

 TestHits (const edm::ParameterSet &)
 
 ~TestHits ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginRun (edm::Run &run, const edm::EventSetup &)
 
virtual void endJob ()
 
std::pair< LocalPoint,
LocalVector
projectHit (const PSimHit &, const StripGeomDetUnit *, const BoundPlane &)
 

Private Attributes

std::string builderName
 
const edm::ParameterSet conf_
 
TFile * file
 
edm::ESHandle< TrajectoryFitterfit
 
std::string fname
 
std::map< std::string, TH1F * > hChi2Increment
 
TH2F * hClsize_vs_Chi2
 
TrackerHitAssociatorhitAssociator
 
TH2F * hProcess_vs_Chi2
 
std::map< std::string, TH1F * > hPullGM_X_ts
 
std::map< std::string, TH1F * > hPullGM_X_ts_mono
 
std::map< std::string, TH1F * > hPullGM_X_ts_stereo
 
std::map< std::string, TH1F * > hPullGM_Y_ts
 
std::map< std::string, TH1F * > hPullGM_Y_ts_mono
 
std::map< std::string, TH1F * > hPullGM_Y_ts_stereo
 
std::map< std::string, TH1F * > hPullGM_Z_ts
 
std::map< std::string, TH1F * > hPullGM_Z_ts_mono
 
std::map< std::string, TH1F * > hPullGM_Z_ts_stereo
 
std::map< std::string, TH1F * > hPullGP_X_rs
 
std::map< std::string, TH1F * > hPullGP_X_rs_mono
 
std::map< std::string, TH1F * > hPullGP_X_rs_stereo
 
std::map< std::string, TH1F * > hPullGP_X_tr
 
std::map< std::string, TH1F * > hPullGP_X_tr_mono
 
std::map< std::string, TH1F * > hPullGP_X_tr_stereo
 
std::map< std::string, TH1F * > hPullGP_X_ts
 
std::map< std::string, TH1F * > hPullGP_X_ts_mono
 
std::map< std::string, TH1F * > hPullGP_X_ts_stereo
 
std::map< std::string, TH1F * > hPullGP_Y_rs
 
std::map< std::string, TH1F * > hPullGP_Y_rs_mono
 
std::map< std::string, TH1F * > hPullGP_Y_rs_stereo
 
std::map< std::string, TH1F * > hPullGP_Y_tr
 
std::map< std::string, TH1F * > hPullGP_Y_tr_mono
 
std::map< std::string, TH1F * > hPullGP_Y_tr_stereo
 
std::map< std::string, TH1F * > hPullGP_Y_ts
 
std::map< std::string, TH1F * > hPullGP_Y_ts_mono
 
std::map< std::string, TH1F * > hPullGP_Y_ts_stereo
 
std::map< std::string, TH1F * > hPullGP_Z_rs
 
std::map< std::string, TH1F * > hPullGP_Z_rs_mono
 
std::map< std::string, TH1F * > hPullGP_Z_rs_stereo
 
std::map< std::string, TH1F * > hPullGP_Z_tr
 
std::map< std::string, TH1F * > hPullGP_Z_tr_mono
 
std::map< std::string, TH1F * > hPullGP_Z_tr_stereo
 
std::map< std::string, TH1F * > hPullGP_Z_ts
 
std::map< std::string, TH1F * > hPullGP_Z_ts_mono
 
std::map< std::string, TH1F * > hPullGP_Z_ts_stereo
 
TH1F * hTotChi2Increment
 
double maxeta
 
double mineta
 
std::string propagatorName
 
std::string srcName
 
edm::ESHandle
< TransientTrackingRecHitBuilder
theBuilder
 
edm::ESHandle< TrackerGeometrytheG
 
edm::ESHandle< MagneticFieldtheMF
 
edm::ESHandle< PropagatorthePropagator
 
edm::Handle
< TrackCandidateCollection
theTCCollection
 
std::stringstream title
 

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
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 50 of file TestHits.h.

Constructor & Destructor Documentation

TestHits::TestHits ( const edm::ParameterSet iConfig)
explicit

Definition at line 28 of file TestHits.cc.

References builderName, conf_, fname, edm::ParameterSet::getParameter(), LogTrace, maxeta, mineta, propagatorName, and srcName.

28  :
29  conf_(iConfig){
30  LogTrace("TestHits") << conf_<< std::endl;
31  propagatorName = conf_.getParameter<std::string>("Propagator");
32  builderName = conf_.getParameter<std::string>("TTRHBuilder");
33  srcName = conf_.getParameter<std::string>("src");
34  fname = conf_.getParameter<std::string>("Fitter");
35  mineta = conf_.getParameter<double>("mineta");
36  maxeta = conf_.getParameter<double>("maxeta");
37 }
T getParameter(std::string const &) const
std::string builderName
Definition: TestHits.h:68
double mineta
Definition: TestHits.h:65
std::string propagatorName
Definition: TestHits.h:67
#define LogTrace(id)
const edm::ParameterSet conf_
Definition: TestHits.h:62
std::string fname
Definition: TestHits.h:70
std::string srcName
Definition: TestHits.h:69
double maxeta
Definition: TestHits.h:65
TestHits::~TestHits ( )

Definition at line 39 of file TestHits.cc.

39 {}

Member Function Documentation

void TestHits::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 192 of file TestHits.cc.

References TrackerHitAssociator::associateHit(), TrajectoryStateOnSurface::cartesianError(), heavyFlavorValidationHarvestingSequence_cff::combiner, GlobalErrorBase< T, ErrorWeightType >::cxx(), GlobalErrorBase< T, ErrorWeightType >::cyy(), GlobalErrorBase< T, ErrorWeightType >::czz(), delta, PTrajectoryStateOnDet::detId(), fit, edm::Event::getByLabel(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), hChi2Increment, hClsize_vs_Chi2, hitAssociator, hProcess_vs_Chi2, hPullGM_X_ts, hPullGM_X_ts_mono, hPullGM_X_ts_stereo, hPullGM_Y_ts, hPullGM_Y_ts_mono, hPullGM_Y_ts_stereo, hPullGM_Z_ts, hPullGM_Z_ts_mono, hPullGM_Z_ts_stereo, hPullGP_X_rs, hPullGP_X_rs_mono, hPullGP_X_rs_stereo, hPullGP_X_tr, hPullGP_X_tr_mono, hPullGP_X_tr_stereo, hPullGP_X_ts, hPullGP_X_ts_mono, hPullGP_X_ts_stereo, hPullGP_Y_rs, hPullGP_Y_rs_mono, hPullGP_Y_rs_stereo, hPullGP_Y_tr, hPullGP_Y_tr_mono, hPullGP_Y_tr_stereo, hPullGP_Y_ts, hPullGP_Y_ts_mono, hPullGP_Y_ts_stereo, hPullGP_Z_rs, hPullGP_Z_rs_mono, hPullGP_Z_rs_stereo, hPullGP_Z_tr, hPullGP_Z_tr_mono, hPullGP_Z_tr_stereo, hPullGP_Z_ts, hPullGP_Z_ts_mono, hPullGP_Z_ts_stereo, hTotChi2Increment, i, errorMatrix2Lands_multiChannel::id, TrajectoryStateOnSurface::isValid(), PSimHit::localPosition(), LogTrace, m, mag(), CartesianTrajectoryError::matrix(), maxeta, mineta, PSimHit::momentumAtEntry(), GloballyPositioned< T >::position(), CartesianTrajectoryError::position(), PSimHit::processType(), edm::ESHandle< class >::product(), projectHit(), TrackCandidate::recHits(), query::result, alignCSCRings::s, TrackCandidate::seed(), mathSSE::sqrt(), srcName, evf::utils::state, theBuilder, theG, theMF, thePropagator, theTCCollection, title, Surface::toGlobal(), TrackCandidate::trajectoryStateOnDet(), trajectoryStateTransform::transientState(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

193 {
194  LogTrace("TestHits") << "\nnew event";
195 
197  hitAssociator = new TrackerHitAssociator(iEvent);
198 
200 
201  for (TrackCandidateCollection::const_iterator i=theTCCollection->begin(); i!=theTCCollection->end();i++){
202 
203  LogTrace("TestHits") << "\n*****************new candidate*****************" << std::endl;
204 
205  const TrackCandidate * theTC = &(*i);
207  const TrackCandidate::range& recHitVec=theTC->recHits();
208 
209  //convert PTrajectoryStateOnDet to TrajectoryStateOnSurface
210 
211 
212  DetId detId(state.detId());
213  TrajectoryStateOnSurface theTSOS=
214  trajectoryStateTransform::transientState(state, &(theG->idToDet(detId)->surface()),theMF.product());
215 
216  if (theTSOS.globalMomentum().eta()>maxeta || theTSOS.globalMomentum().eta()<mineta) continue;
217 
218  //convert the TrackingRecHit vector to a TransientTrackingRecHit vector
220 
222  i!=recHitVec.second; i++){
223  hits.push_back(theBuilder->build(&(*i) ));
224  }
225 
226  //call the fitter
227  std::vector<Trajectory> result = fit->fit(theTC->seed(), hits, theTSOS);
228  if (result.size()==0) continue;
229  std::vector<TrajectoryMeasurement> vtm = result[0].measurements();
230  double tchi2 = 0;
231 
232  TSOS lastState = theTSOS;
233  for (std::vector<TrajectoryMeasurement>::iterator tm=vtm.begin(); tm!=vtm.end();tm++){
234 
236  if ((rhit)->isValid()==0&&rhit->det()!=0) continue;
237  LogTrace("TestHits") << "*****************new hit*****************" ;
238 
239  int subdetId = rhit->det()->geographicalId().subdetId();
240  int layerId = 0;
241  DetId id = rhit->det()->geographicalId();
242  if (id.subdetId()==3) layerId = ((TIBDetId)(id)).layer();
243  if (id.subdetId()==5) layerId = ((TOBDetId)(id)).layer();
244  if (id.subdetId()==1) layerId = ((PXBDetId)(id)).layer();
245  if (id.subdetId()==4) layerId = ((TIDDetId)(id)).wheel();
246  if (id.subdetId()==6) layerId = ((TECDetId)(id)).wheel();
247  if (id.subdetId()==2) layerId = ((PXFDetId)(id)).disk();
248  LogTrace("TestHits") << "subdetId=" << subdetId << " layerId=" << layerId ;
249 
250  double delta = 99999;
251  LocalPoint rhitLPv = rhit->localPosition();
252 
253  std::vector<PSimHit> assSimHits = hitAssociator->associateHit(*(rhit->hit()));
254  if (assSimHits.size()==0) continue;
255  PSimHit shit;
256  for(std::vector<PSimHit>::const_iterator m=assSimHits.begin(); m<assSimHits.end(); m++){
257  if ((m->localPosition()-rhitLPv).mag()<delta) {
258  shit=*m;
259  delta = (m->localPosition()-rhitLPv).mag();
260  }
261  }
262 
263  TSOS currentState = tm->forwardPredictedState();
264  if (tm->backwardPredictedState().isValid())
265  currentState = combiner(tm->backwardPredictedState(), tm->forwardPredictedState());
266  TSOS updatedState = tm->updatedState();
267  tchi2+=tm->estimate();
268 
269  //plot chi2 increment
270  double chi2increment = tm->estimate();
271  LogTrace("TestHits") << "tm->estimate()=" << tm->estimate();
272  title.str("");
273  title << "Chi2Increment_" << subdetId << "-" << layerId;
274  hChi2Increment[title.str()]->Fill( chi2increment );
275  hTotChi2Increment->Fill( chi2increment );
276  hProcess_vs_Chi2->Fill( chi2increment, shit.processType() );
277  if (dynamic_cast<const SiPixelRecHit*>(rhit->hit()))
278  hClsize_vs_Chi2->Fill( chi2increment, ((const SiPixelRecHit*)(rhit->hit()))->cluster()->size() );
279  if (dynamic_cast<const SiStripRecHit2D*>(rhit->hit()))
280  hClsize_vs_Chi2->Fill( chi2increment, ((const SiStripRecHit2D*)(rhit->hit()))->cluster()->amplitudes().size() );
281 
282  //test hits
283  const Surface * surf = &( (rhit)->det()->surface() );
284  LocalVector shitLMom;
285  LocalPoint shitLPos;
286  if (dynamic_cast<const SiStripMatchedRecHit2D*>((rhit)->hit())) {
287  double rechitmatchedx = rhit->localPosition().x();
288  double rechitmatchedy = rhit->localPosition().y();
289  double mindist = 999999;
290  double distx, disty;
291  std::pair<LocalPoint,LocalVector> closestPair;
292  const StripGeomDetUnit* stripDet =(StripGeomDetUnit*) ((const GluedGeomDet *)(rhit)->det())->stereoDet();
293  const BoundPlane& plane = (rhit)->det()->surface();
294  for(std::vector<PSimHit>::const_iterator m=assSimHits.begin(); m<assSimHits.end(); m++) {
295  //project simhit;
296  std::pair<LocalPoint,LocalVector> hitPair = projectHit((*m),stripDet,plane);
297  distx = fabs(rechitmatchedx - hitPair.first.x());
298  disty = fabs(rechitmatchedy - hitPair.first.y());
299  double dist = distx*distx+disty*disty;
300  if(sqrt(dist)<mindist){
301  mindist = dist;
302  closestPair = hitPair;
303  }
304  }
305  shitLPos = closestPair.first;
306  shitLMom = closestPair.second;
307  } else {
308  shitLPos = shit.localPosition();
309  shitLMom = shit.momentumAtEntry();
310  }
311  GlobalVector shitGMom = surf->toGlobal(shitLMom);
312  GlobalPoint shitGPos = surf->toGlobal(shitLPos);
313 
314  GlobalVector tsosGMom = currentState.globalMomentum();
315  GlobalError tsosGMEr(currentState.cartesianError().matrix().Sub<AlgebraicSymMatrix33>(3,3));
316  GlobalPoint tsosGPos = currentState.globalPosition();
317  GlobalError tsosGPEr = currentState.cartesianError().position();
318 
319  GlobalPoint rhitGPos = (rhit)->globalPosition();
320  GlobalError rhitGPEr = (rhit)->globalPositionError();
321 
322  double pullGPX_rs = (rhitGPos.x()-shitGPos.x())/sqrt(rhitGPEr.cxx());
323  double pullGPY_rs = (rhitGPos.y()-shitGPos.y())/sqrt(rhitGPEr.cyy());
324  double pullGPZ_rs = (rhitGPos.z()-shitGPos.z())/sqrt(rhitGPEr.czz());
325  //double pullGPX_rs = (rhitGPos.x()-shitGPos.x());
326  //double pullGPY_rs = (rhitGPos.y()-shitGPos.y());
327  //double pullGPZ_rs = (rhitGPos.z()-shitGPos.z());
328 
329  LogTrace("TestHits") << "rs" << std::endl;
330  LogVerbatim("TestHits") << "assSimHits.size()=" << assSimHits.size() ;
331  LogVerbatim("TestHits") << "tsos globalPos =" << tsosGPos ;
332  LogVerbatim("TestHits") << "sim hit globalPos=" << shitGPos ;
333  LogVerbatim("TestHits") << "rec hit globalPos=" << rhitGPos ;
334  LogVerbatim("TestHits") << "geographicalId =" << rhit->det()->geographicalId().rawId() ;
335  LogVerbatim("TestHits") << "surface position =" << surf->position() ;
336 
337  title.str("");
338  title << "PullGP_X_" << subdetId << "-" << layerId << "_rs";
339  hPullGP_X_rs[title.str()]->Fill( pullGPX_rs );
340  title.str("");
341  title << "PullGP_Y_" << subdetId << "-" << layerId << "_rs";
342  hPullGP_Y_rs[title.str()]->Fill( pullGPY_rs );
343  title.str("");
344  title << "PullGP_Z_" << subdetId << "-" << layerId << "_rs";
345  hPullGP_Z_rs[title.str()]->Fill( pullGPZ_rs );
346 
347  double pullGPX_tr = (tsosGPos.x()-rhitGPos.x())/sqrt(tsosGPEr.cxx()+rhitGPEr.cxx());
348  double pullGPY_tr = (tsosGPos.y()-rhitGPos.y())/sqrt(tsosGPEr.cyy()+rhitGPEr.cyy());
349  double pullGPZ_tr = (tsosGPos.z()-rhitGPos.z())/sqrt(tsosGPEr.czz()+rhitGPEr.czz());
350  //double pullGPX_tr = (tsosGPos.x()-rhitGPos.x());
351  //double pullGPY_tr = (tsosGPos.y()-rhitGPos.y());
352  //double pullGPZ_tr = (tsosGPos.z()-rhitGPos.z());
353 
354  LogTrace("TestHits") << "tr" << std::endl;
355 
356  title.str("");
357  title << "PullGP_X_" << subdetId << "-" << layerId << "_tr";
358  hPullGP_X_tr[title.str()]->Fill( pullGPX_tr );
359  title.str("");
360  title << "PullGP_Y_" << subdetId << "-" << layerId << "_tr";
361  hPullGP_Y_tr[title.str()]->Fill( pullGPY_tr );
362  title.str("");
363  title << "PullGP_Z_" << subdetId << "-" << layerId << "_tr";
364  hPullGP_Z_tr[title.str()]->Fill( pullGPZ_tr );
365 
366  double pullGPX_ts = (tsosGPos.x()-shitGPos.x())/sqrt(tsosGPEr.cxx());
367  double pullGPY_ts = (tsosGPos.y()-shitGPos.y())/sqrt(tsosGPEr.cyy());
368  double pullGPZ_ts = (tsosGPos.z()-shitGPos.z())/sqrt(tsosGPEr.czz());
369  //double pullGPX_ts = (tsosGPos.x()-shitGPos.x());
370  //double pullGPY_ts = (tsosGPos.y()-shitGPos.y());
371  //double pullGPZ_ts = (tsosGPos.z()-shitGPos.z());
372 
373  LogTrace("TestHits") << "ts1" << std::endl;
374 
375  title.str("");
376  title << "PullGP_X_" << subdetId << "-" << layerId << "_ts";
377  hPullGP_X_ts[title.str()]->Fill( pullGPX_ts );
378  title.str("");
379  title << "PullGP_Y_" << subdetId << "-" << layerId << "_ts";
380  hPullGP_Y_ts[title.str()]->Fill( pullGPY_ts );
381  title.str("");
382  title << "PullGP_Z_" << subdetId << "-" << layerId << "_ts";
383  hPullGP_Z_ts[title.str()]->Fill( pullGPZ_ts );
384 
385  double pullGMX_ts = (tsosGMom.x()-shitGMom.x())/sqrt(tsosGMEr.cxx());
386  double pullGMY_ts = (tsosGMom.y()-shitGMom.y())/sqrt(tsosGMEr.cyy());
387  double pullGMZ_ts = (tsosGMom.z()-shitGMom.z())/sqrt(tsosGMEr.czz());
388  //double pullGMX_ts = (tsosGMom.x()-shitGMom.x());
389  //double pullGMY_ts = (tsosGMom.y()-shitGMom.y());
390  //double pullGMZ_ts = (tsosGMom.z()-shitGMom.z());
391 
392  LogTrace("TestHits") << "ts2" << std::endl;
393 
394  title.str("");
395  title << "PullGM_X_" << subdetId << "-" << layerId << "_ts";
396  hPullGM_X_ts[title.str()]->Fill( pullGMX_ts );
397  title.str("");
398  title << "PullGM_Y_" << subdetId << "-" << layerId << "_ts";
399  hPullGM_Y_ts[title.str()]->Fill( pullGMY_ts );
400  title.str("");
401  title << "PullGM_Z_" << subdetId << "-" << layerId << "_ts";
402  hPullGM_Z_ts[title.str()]->Fill( pullGMZ_ts );
403 
404  if (dynamic_cast<const SiStripMatchedRecHit2D*>((rhit)->hit())) {
405  //mono
406  LogTrace("TestHits") << "MONO HIT" << std::endl;
407  auto m = dynamic_cast<const SiStripMatchedRecHit2D*>((rhit)->hit())->monoHit();
408  CTTRHp tMonoHit = theBuilder->build(&m);
409  if (tMonoHit==0) continue;
410  vector<PSimHit> assMonoSimHits = hitAssociator->associateHit(*tMonoHit->hit());
411  if (assMonoSimHits.size()==0) continue;
412  const PSimHit sMonoHit = *(assSimHits.begin());
413  const Surface * monoSurf = &( tMonoHit->det()->surface() );
414  if (monoSurf==0) continue;
415  TSOS monoState = thePropagator->propagate(lastState,*monoSurf);
416  if (monoState.isValid()==0) continue;
417 
418  LocalVector monoShitLMom = sMonoHit.momentumAtEntry();
419  GlobalVector monoShitGMom = monoSurf->toGlobal(monoShitLMom);
420  LocalPoint monoShitLPos = sMonoHit.localPosition();
421  GlobalPoint monoShitGPos = monoSurf->toGlobal(monoShitLPos);
422 
423  GlobalVector monoTsosGMom = monoState.globalMomentum();
424  GlobalError monoTsosGMEr(monoState.cartesianError().matrix().Sub<AlgebraicSymMatrix33>(3,3));
425  GlobalPoint monoTsosGPos = monoState.globalPosition();
426  GlobalError monoTsosGPEr = monoState.cartesianError().position();
427 
428  GlobalPoint monoRhitGPos = tMonoHit->globalPosition();
429  GlobalError monoRhitGPEr = tMonoHit->globalPositionError();
430 
431  double pullGPX_rs_mono = (monoRhitGPos.x()-monoShitGPos.x())/sqrt(monoRhitGPEr.cxx());
432  double pullGPY_rs_mono = (monoRhitGPos.y()-monoShitGPos.y())/sqrt(monoRhitGPEr.cyy());
433  double pullGPZ_rs_mono = (monoRhitGPos.z()-monoShitGPos.z())/sqrt(monoRhitGPEr.czz());
434  //double pullGPX_rs_mono = (monoRhitGPos.x()-monoShitGPos.x());
435  //double pullGPY_rs_mono = (monoRhitGPos.y()-monoShitGPos.y());
436  //double pullGPZ_rs_mono = (monoRhitGPos.z()-monoShitGPos.z());
437 
438  title.str("");
439  title << "PullGP_X_" << subdetId << "-" << layerId << "_rs_mono";
440  hPullGP_X_rs_mono[title.str()]->Fill( pullGPX_rs_mono );
441  title.str("");
442  title << "PullGP_Y_" << subdetId << "-" << layerId << "_rs_mono";
443  hPullGP_Y_rs_mono[title.str()]->Fill( pullGPY_rs_mono );
444  title.str("");
445  title << "PullGP_Z_" << subdetId << "-" << layerId << "_rs_mono";
446  hPullGP_Z_rs_mono[title.str()]->Fill( pullGPZ_rs_mono );
447 
448  double pullGPX_tr_mono = (monoTsosGPos.x()-monoRhitGPos.x())/sqrt(monoTsosGPEr.cxx()+monoRhitGPEr.cxx());
449  double pullGPY_tr_mono = (monoTsosGPos.y()-monoRhitGPos.y())/sqrt(monoTsosGPEr.cyy()+monoRhitGPEr.cyy());
450  double pullGPZ_tr_mono = (monoTsosGPos.z()-monoRhitGPos.z())/sqrt(monoTsosGPEr.czz()+monoRhitGPEr.czz());
451  //double pullGPX_tr_mono = (monoTsosGPos.x()-monoRhitGPos.x());
452  //double pullGPY_tr_mono = (monoTsosGPos.y()-monoRhitGPos.y());
453  //double pullGPZ_tr_mono = (monoTsosGPos.z()-monoRhitGPos.z());
454 
455  title.str("");
456  title << "PullGP_X_" << subdetId << "-" << layerId << "_tr_mono";
457  hPullGP_X_tr_mono[title.str()]->Fill( pullGPX_tr_mono );
458  title.str("");
459  title << "PullGP_Y_" << subdetId << "-" << layerId << "_tr_mono";
460  hPullGP_Y_tr_mono[title.str()]->Fill( pullGPY_tr_mono );
461  title.str("");
462  title << "PullGP_Z_" << subdetId << "-" << layerId << "_tr_mono";
463  hPullGP_Z_tr_mono[title.str()]->Fill( pullGPZ_tr_mono );
464 
465  double pullGPX_ts_mono = (monoTsosGPos.x()-monoShitGPos.x())/sqrt(monoTsosGPEr.cxx());
466  double pullGPY_ts_mono = (monoTsosGPos.y()-monoShitGPos.y())/sqrt(monoTsosGPEr.cyy());
467  double pullGPZ_ts_mono = (monoTsosGPos.z()-monoShitGPos.z())/sqrt(monoTsosGPEr.czz());
468  //double pullGPX_ts_mono = (monoTsosGPos.x()-monoShitGPos.x());
469  //double pullGPY_ts_mono = (monoTsosGPos.y()-monoShitGPos.y());
470  //double pullGPZ_ts_mono = (monoTsosGPos.z()-monoShitGPos.z());
471 
472  title.str("");
473  title << "PullGP_X_" << subdetId << "-" << layerId << "_ts_mono";
474  hPullGP_X_ts_mono[title.str()]->Fill( pullGPX_ts_mono );
475  title.str("");
476  title << "PullGP_Y_" << subdetId << "-" << layerId << "_ts_mono";
477  hPullGP_Y_ts_mono[title.str()]->Fill( pullGPY_ts_mono );
478  title.str("");
479  title << "PullGP_Z_" << subdetId << "-" << layerId << "_ts_mono";
480  hPullGP_Z_ts_mono[title.str()]->Fill( pullGPZ_ts_mono );
481 
482  double pullGMX_ts_mono = (monoTsosGMom.x()-monoShitGMom.x())/sqrt(monoTsosGMEr.cxx());
483  double pullGMY_ts_mono = (monoTsosGMom.y()-monoShitGMom.y())/sqrt(monoTsosGMEr.cyy());
484  double pullGMZ_ts_mono = (monoTsosGMom.z()-monoShitGMom.z())/sqrt(monoTsosGMEr.czz());
485  //double pullGMX_ts_mono = (monoTsosGMom.x()-monoShitGMom.x());
486  //double pullGMY_ts_mono = (monoTsosGMom.y()-monoShitGMom.y());
487  //double pullGMZ_ts_mono = (monoTsosGMom.z()-monoShitGMom.z());
488 
489  title.str("");
490  title << "PullGM_X_" << subdetId << "-" << layerId << "_ts_mono";
491  hPullGM_X_ts_mono[title.str()]->Fill( pullGMX_ts_mono );
492  title.str("");
493  title << "PullGM_Y_" << subdetId << "-" << layerId << "_ts_mono";
494  hPullGM_Y_ts_mono[title.str()]->Fill( pullGMY_ts_mono );
495  title.str("");
496  title << "PullGM_Z_" << subdetId << "-" << layerId << "_ts_mono";
497  hPullGM_Z_ts_mono[title.str()]->Fill( pullGMZ_ts_mono );
498 
499  //stereo
500  LogTrace("TestHits") << "STEREO HIT" << std::endl;
501  auto s = dynamic_cast<const SiStripMatchedRecHit2D*>((rhit)->hit())->stereoHit();
502  CTTRHp tStereoHit =
503  theBuilder->build(&s);
504  if (tStereoHit==0) continue;
505  vector<PSimHit> assStereoSimHits = hitAssociator->associateHit(*tStereoHit->hit());
506  if (assStereoSimHits.size()==0) continue;
507  const PSimHit sStereoHit = *(assSimHits.begin());
508  const Surface * stereoSurf = &( tStereoHit->det()->surface() );
509  if (stereoSurf==0) continue;
510  TSOS stereoState = thePropagator->propagate(lastState,*stereoSurf);
511  if (stereoState.isValid()==0) continue;
512 
513  LocalVector stereoShitLMom = sStereoHit.momentumAtEntry();
514  GlobalVector stereoShitGMom = stereoSurf->toGlobal(stereoShitLMom);
515  LocalPoint stereoShitLPos = sStereoHit.localPosition();
516  GlobalPoint stereoShitGPos = stereoSurf->toGlobal(stereoShitLPos);
517 
518  GlobalVector stereoTsosGMom = stereoState.globalMomentum();
519  GlobalError stereoTsosGMEr(stereoState.cartesianError().matrix().Sub<AlgebraicSymMatrix33>(3,3));
520  GlobalPoint stereoTsosGPos = stereoState.globalPosition();
521  GlobalError stereoTsosGPEr = stereoState.cartesianError().position();
522 
523  GlobalPoint stereoRhitGPos = tStereoHit->globalPosition();
524  GlobalError stereoRhitGPEr = tStereoHit->globalPositionError();
525 
526  double pullGPX_rs_stereo = (stereoRhitGPos.x()-stereoShitGPos.x())/sqrt(stereoRhitGPEr.cxx());
527  double pullGPY_rs_stereo = (stereoRhitGPos.y()-stereoShitGPos.y())/sqrt(stereoRhitGPEr.cyy());
528  double pullGPZ_rs_stereo = (stereoRhitGPos.z()-stereoShitGPos.z())/sqrt(stereoRhitGPEr.czz());
529  //double pullGPX_rs_stereo = (stereoRhitGPos.x()-stereoShitGPos.x());
530  //double pullGPY_rs_stereo = (stereoRhitGPos.y()-stereoShitGPos.y());
531  //double pullGPZ_rs_stereo = (stereoRhitGPos.z()-stereoShitGPos.z());
532 
533  title.str("");
534  title << "PullGP_X_" << subdetId << "-" << layerId << "_rs_stereo";
535  hPullGP_X_rs_stereo[title.str()]->Fill( pullGPX_rs_stereo );
536  title.str("");
537  title << "PullGP_Y_" << subdetId << "-" << layerId << "_rs_stereo";
538  hPullGP_Y_rs_stereo[title.str()]->Fill( pullGPY_rs_stereo );
539  title.str("");
540  title << "PullGP_Z_" << subdetId << "-" << layerId << "_rs_stereo";
541  hPullGP_Z_rs_stereo[title.str()]->Fill( pullGPZ_rs_stereo );
542 
543  double pullGPX_tr_stereo = (stereoTsosGPos.x()-stereoRhitGPos.x())/sqrt(stereoTsosGPEr.cxx()+stereoRhitGPEr.cxx());
544  double pullGPY_tr_stereo = (stereoTsosGPos.y()-stereoRhitGPos.y())/sqrt(stereoTsosGPEr.cyy()+stereoRhitGPEr.cyy());
545  double pullGPZ_tr_stereo = (stereoTsosGPos.z()-stereoRhitGPos.z())/sqrt(stereoTsosGPEr.czz()+stereoRhitGPEr.czz());
546  //double pullGPX_tr_stereo = (stereoTsosGPos.x()-stereoRhitGPos.x());
547  //double pullGPY_tr_stereo = (stereoTsosGPos.y()-stereoRhitGPos.y());
548  //double pullGPZ_tr_stereo = (stereoTsosGPos.z()-stereoRhitGPos.z());
549 
550  title.str("");
551  title << "PullGP_X_" << subdetId << "-" << layerId << "_tr_stereo";
552  hPullGP_X_tr_stereo[title.str()]->Fill( pullGPX_tr_stereo );
553  title.str("");
554  title << "PullGP_Y_" << subdetId << "-" << layerId << "_tr_stereo";
555  hPullGP_Y_tr_stereo[title.str()]->Fill( pullGPY_tr_stereo );
556  title.str("");
557  title << "PullGP_Z_" << subdetId << "-" << layerId << "_tr_stereo";
558  hPullGP_Z_tr_stereo[title.str()]->Fill( pullGPZ_tr_stereo );
559 
560  double pullGPX_ts_stereo = (stereoTsosGPos.x()-stereoShitGPos.x())/sqrt(stereoTsosGPEr.cxx());
561  double pullGPY_ts_stereo = (stereoTsosGPos.y()-stereoShitGPos.y())/sqrt(stereoTsosGPEr.cyy());
562  double pullGPZ_ts_stereo = (stereoTsosGPos.z()-stereoShitGPos.z())/sqrt(stereoTsosGPEr.czz());
563  //double pullGPX_ts_stereo = (stereoTsosGPos.x()-stereoShitGPos.x());
564  //double pullGPY_ts_stereo = (stereoTsosGPos.y()-stereoShitGPos.y());
565  //double pullGPZ_ts_stereo = (stereoTsosGPos.z()-stereoShitGPos.z());
566 
567  title.str("");
568  title << "PullGP_X_" << subdetId << "-" << layerId << "_ts_stereo";
569  hPullGP_X_ts_stereo[title.str()]->Fill( pullGPX_ts_stereo );
570  title.str("");
571  title << "PullGP_Y_" << subdetId << "-" << layerId << "_ts_stereo";
572  hPullGP_Y_ts_stereo[title.str()]->Fill( pullGPY_ts_stereo );
573  title.str("");
574  title << "PullGP_Z_" << subdetId << "-" << layerId << "_ts_stereo";
575  hPullGP_Z_ts_stereo[title.str()]->Fill( pullGPZ_ts_stereo );
576 
577  double pullGMX_ts_stereo = (stereoTsosGMom.x()-stereoShitGMom.x())/sqrt(stereoTsosGMEr.cxx());
578  double pullGMY_ts_stereo = (stereoTsosGMom.y()-stereoShitGMom.y())/sqrt(stereoTsosGMEr.cyy());
579  double pullGMZ_ts_stereo = (stereoTsosGMom.z()-stereoShitGMom.z())/sqrt(stereoTsosGMEr.czz());
580  //double pullGMX_ts_stereo = (stereoTsosGMom.x()-stereoShitGMom.x());
581  //double pullGMY_ts_stereo = (stereoTsosGMom.y()-stereoShitGMom.y());
582  //double pullGMZ_ts_stereo = (stereoTsosGMom.z()-stereoShitGMom.z());
583 
584  title.str("");
585  title << "PullGM_X_" << subdetId << "-" << layerId << "_ts_stereo";
586  hPullGM_X_ts_stereo[title.str()]->Fill( pullGMX_ts_stereo );
587  title.str("");
588  title << "PullGM_Y_" << subdetId << "-" << layerId << "_ts_stereo";
589  hPullGM_Y_ts_stereo[title.str()]->Fill( pullGMY_ts_stereo );
590  title.str("");
591  title << "PullGM_Z_" << subdetId << "-" << layerId << "_ts_stereo";
592  hPullGM_Z_ts_stereo[title.str()]->Fill( pullGMZ_ts_stereo );
593  }
594  lastState = updatedState;
595  }
596  LogTrace("TestHits") << "traj chi2=" << tchi2 ;
597  LogTrace("TestHits") << "track chi2=" << result[0].chiSquared() ;
598  }
599  delete hitAssociator;
600  LogTrace("TestHits") << "end of event" << std::endl;
601 }
edm::Handle< TrackCandidateCollection > theTCCollection
Definition: TestHits.h:77
dbl * delta
Definition: mlp_gen.cc:36
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
int i
Definition: DBlmapReader.cc:9
std::pair< LocalPoint, LocalVector > projectHit(const PSimHit &, const StripGeomDetUnit *, const BoundPlane &)
Definition: TestHits.cc:1188
std::map< std::string, TH1F * > hPullGP_Y_tr_mono
Definition: TestHits.h:107
std::map< std::string, TH1F * > hPullGP_X_rs_mono
Definition: TestHits.h:103
std::map< std::string, TH1F * > hPullGP_Z_tr_stereo
Definition: TestHits.h:121
TH1F * hTotChi2Increment
Definition: TestHits.h:94
range recHits() const
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
Definition: TestHits.h:75
std::map< std::string, TH1F * > hPullGP_Z_ts_mono
Definition: TestHits.h:99
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
Definition: PSimHit.h:47
std::map< std::string, TH1F * > hPullGM_X_ts_stereo
Definition: TestHits.h:113
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
std::map< std::string, TH1F * > hPullGM_X_ts_mono
Definition: TestHits.h:100
double mineta
Definition: TestHits.h:65
TrajectorySeed const & seed() const
const CartesianTrajectoryError cartesianError() const
T y() const
Definition: PV3DBase.h:62
GlobalPoint globalPosition() const
std::map< std::string, TH1F * > hPullGP_Y_ts
Definition: TestHits.h:82
std::map< std::string, TH1F * > hChi2Increment
Definition: TestHits.h:93
std::pair< const_iterator, const_iterator > range
std::map< std::string, TH1F * > hPullGP_Y_ts_stereo
Definition: TestHits.h:111
std::map< std::string, TH1F * > hPullGP_Z_rs
Definition: TestHits.h:89
edm::ESHandle< Propagator > thePropagator
Definition: TestHits.h:74
std::map< std::string, TH1F * > hPullGP_Y_rs
Definition: TestHits.h:88
std::vector< ConstRecHitPointer > RecHitContainer
std::map< std::string, TH1F * > hPullGP_X_tr_stereo
Definition: TestHits.h:119
std::map< std::string, TH1F * > hPullGP_Z_rs_stereo
Definition: TestHits.h:118
PTrajectoryStateOnDet const & trajectoryStateOnDet() const
TrackerHitAssociator * hitAssociator
Definition: TestHits.h:63
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
std::map< std::string, TH1F * > hPullGP_Y_tr
Definition: TestHits.h:91
Local3DPoint localPosition() const
Definition: PSimHit.h:44
T sqrt(T t)
Definition: SSEVec.h:46
std::map< std::string, TH1F * > hPullGP_X_rs_stereo
Definition: TestHits.h:116
T z() const
Definition: PV3DBase.h:63
tuple result
Definition: query.py:137
std::map< std::string, TH1F * > hPullGP_Y_tr_stereo
Definition: TestHits.h:120
std::map< std::string, TH1F * > hPullGP_Y_rs_mono
Definition: TestHits.h:104
std::map< std::string, TH1F * > hPullGM_Z_ts
Definition: TestHits.h:86
unsigned int detId() const
std::map< std::string, TH1F * > hPullGM_Y_ts_mono
Definition: TestHits.h:101
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
std::map< std::string, TH1F * > hPullGP_Z_rs_mono
Definition: TestHits.h:105
#define LogTrace(id)
std::map< std::string, TH1F * > hPullGP_X_ts_stereo
Definition: TestHits.h:110
std::map< std::string, TH1F * > hPullGP_Y_rs_stereo
Definition: TestHits.h:117
const AlgebraicSymMatrix66 & matrix() const
edm::ESHandle< TrackerGeometry > theG
Definition: TestHits.h:72
edm::ESHandle< TrajectoryFitter > fit
Definition: TestHits.h:76
Definition: DetId.h:20
std::map< std::string, TH1F * > hPullGM_Z_ts_stereo
Definition: TestHits.h:115
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
TH2F * hProcess_vs_Chi2
Definition: TestHits.h:95
const GlobalError position() const
Position error submatrix.
T const * product() const
Definition: ESHandle.h:62
std::map< std::string, TH1F * > hPullGP_Z_tr
Definition: TestHits.h:92
std::map< std::string, TH1F * > hPullGP_Y_ts_mono
Definition: TestHits.h:98
unsigned short processType() const
Definition: PSimHit.h:118
char state
Definition: procUtils.cc:75
std::map< std::string, TH1F * > hPullGM_Y_ts_stereo
Definition: TestHits.h:114
edm::ESHandle< MagneticField > theMF
Definition: TestHits.h:73
std::map< std::string, TH1F * > hPullGP_X_tr_mono
Definition: TestHits.h:106
TH2F * hClsize_vs_Chi2
Definition: TestHits.h:95
GlobalVector globalMomentum() const
std::map< std::string, TH1F * > hPullGM_X_ts
Definition: TestHits.h:84
std::map< std::string, TH1F * > hPullGP_X_ts
Definition: TestHits.h:81
std::vector< PSimHit > associateHit(const TrackingRecHit &thit)
std::string srcName
Definition: TestHits.h:69
std::map< std::string, TH1F * > hPullGP_Z_ts
Definition: TestHits.h:83
std::map< std::string, TH1F * > hPullGP_Z_tr_mono
Definition: TestHits.h:108
std::map< std::string, TH1F * > hPullGP_X_ts_mono
Definition: TestHits.h:97
T x() const
Definition: PV3DBase.h:61
const PositionType & position() const
std::map< std::string, TH1F * > hPullGM_Z_ts_mono
Definition: TestHits.h:102
std::map< std::string, TH1F * > hPullGM_Y_ts
Definition: TestHits.h:85
std::map< std::string, TH1F * > hPullGP_X_tr
Definition: TestHits.h:90
std::stringstream title
Definition: TestHits.h:80
Pixel Reconstructed Hit.
double maxeta
Definition: TestHits.h:65
std::map< std::string, TH1F * > hPullGP_Z_ts_stereo
Definition: TestHits.h:112
std::map< std::string, TH1F * > hPullGP_X_rs
Definition: TestHits.h:87
void TestHits::beginRun ( edm::Run run,
const edm::EventSetup iSetup 
)
privatevirtual

Definition at line 41 of file TestHits.cc.

References builderName, file, fit, fname, edm::EventSetup::get(), hChi2Increment, hClsize_vs_Chi2, hProcess_vs_Chi2, hPullGM_X_ts, hPullGM_X_ts_mono, hPullGM_X_ts_stereo, hPullGM_Y_ts, hPullGM_Y_ts_mono, hPullGM_Y_ts_stereo, hPullGM_Z_ts, hPullGM_Z_ts_mono, hPullGM_Z_ts_stereo, hPullGP_X_rs, hPullGP_X_rs_mono, hPullGP_X_rs_stereo, hPullGP_X_tr, hPullGP_X_tr_mono, hPullGP_X_tr_stereo, hPullGP_X_ts, hPullGP_X_ts_mono, hPullGP_X_ts_stereo, hPullGP_Y_rs, hPullGP_Y_rs_mono, hPullGP_Y_rs_stereo, hPullGP_Y_tr, hPullGP_Y_tr_mono, hPullGP_Y_tr_stereo, hPullGP_Y_ts, hPullGP_Y_ts_mono, hPullGP_Y_ts_stereo, hPullGP_Z_rs, hPullGP_Z_rs_mono, hPullGP_Z_rs_stereo, hPullGP_Z_tr, hPullGP_Z_tr_mono, hPullGP_Z_tr_stereo, hPullGP_Z_ts, hPullGP_Z_ts_mono, hPullGP_Z_ts_stereo, hTotChi2Increment, i, j, propagatorName, theBuilder, theG, theMF, thePropagator, and title.

42 {
43 
44  iSetup.get<TrackerDigiGeometryRecord>().get(theG);
45  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
48  iSetup.get<TrajectoryFitter::Record>().get(fname, fit);
49 
50  file = new TFile("testhits.root","recreate");
51  for (int i=0; i!=6; i++)
52  for (int j=0; j!=9; j++){
53  if (i==0 && j>2) break;
54  if (i==1 && j>1) break;
55  if (i==2 && j>3) break;
56  if (i==3 && j>2) break;
57  if (i==4 && j>5) break;
58  if (i==5 && j>8) break;
59  title.str("");
60  title << "PullGP_X_" << i+1 << "-" << j+1 << "_ts";
61  hPullGP_X_ts[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
62  title.str("");
63  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_ts";
64  hPullGP_Y_ts[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
65  title.str("");
66  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_ts";
67  hPullGP_Z_ts[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
68  title.str("");
69  title << "Chi2Increment_" << i+1 << "-" << j+1;
70  hChi2Increment[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,0,100);
71 
72  title.str("");
73  title << "PullGM_X_" << i+1 << "-" << j+1 << "_ts";
74  hPullGM_X_ts[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
75  title.str("");
76  title << "PullGM_Y_" << i+1 << "-" << j+1 << "_ts";
77  hPullGM_Y_ts[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
78  title.str("");
79  title << "PullGM_Z_" << i+1 << "-" << j+1 << "_ts";
80  hPullGM_Z_ts[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
81 
82  title.str("");
83  title << "PullGP_X_" << i+1 << "-" << j+1 << "_tr";
84  hPullGP_X_tr[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
85  title.str("");
86  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_tr";
87  hPullGP_Y_tr[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
88  title.str("");
89  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_tr";
90  hPullGP_Z_tr[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
91 
92  title.str("");
93  title << "PullGP_X_" << i+1 << "-" << j+1 << "_rs";
94  hPullGP_X_rs[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
95  title.str("");
96  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_rs";
97  hPullGP_Y_rs[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
98  title.str("");
99  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_rs";
100  hPullGP_Z_rs[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
101 
102  if ( ((i==2||i==4)&&(j==0||j==1)) || (i==3||i==5) ){
103  //mono
104  title.str("");
105  title << "PullGP_X_" << i+1 << "-" << j+1 << "_ts_mono";
106  hPullGP_X_ts_mono[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
107  title.str("");
108  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_ts_mono";
109  hPullGP_Y_ts_mono[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
110  title.str("");
111  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_ts_mono";
112  hPullGP_Z_ts_mono[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
113 
114  title.str("");
115  title << "PullGM_X_" << i+1 << "-" << j+1 << "_ts_mono";
116  hPullGM_X_ts_mono[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
117  title.str("");
118  title << "PullGM_Y_" << i+1 << "-" << j+1 << "_ts_mono";
119  hPullGM_Y_ts_mono[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
120  title.str("");
121  title << "PullGM_Z_" << i+1 << "-" << j+1 << "_ts_mono";
122  hPullGM_Z_ts_mono[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
123 
124  title.str("");
125  title << "PullGP_X_" << i+1 << "-" << j+1 << "_tr_mono";
126  hPullGP_X_tr_mono[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
127  title.str("");
128  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_tr_mono";
129  hPullGP_Y_tr_mono[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
130  title.str("");
131  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_tr_mono";
132  hPullGP_Z_tr_mono[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
133 
134  title.str("");
135  title << "PullGP_X_" << i+1 << "-" << j+1 << "_rs_mono";
136  hPullGP_X_rs_mono[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
137  title.str("");
138  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_rs_mono";
139  hPullGP_Y_rs_mono[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
140  title.str("");
141  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_rs_mono";
142  hPullGP_Z_rs_mono[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
143 
144  //stereo
145  title.str("");
146  title << "PullGP_X_" << i+1 << "-" << j+1 << "_ts_stereo";
147  hPullGP_X_ts_stereo[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
148  title.str("");
149  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_ts_stereo";
150  hPullGP_Y_ts_stereo[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
151  title.str("");
152  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_ts_stereo";
153  hPullGP_Z_ts_stereo[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
154 
155  title.str("");
156  title << "PullGM_X_" << i+1 << "-" << j+1 << "_ts_stereo";
157  hPullGM_X_ts_stereo[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
158  title.str("");
159  title << "PullGM_Y_" << i+1 << "-" << j+1 << "_ts_stereo";
160  hPullGM_Y_ts_stereo[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
161  title.str("");
162  title << "PullGM_Z_" << i+1 << "-" << j+1 << "_ts_stereo";
163  hPullGM_Z_ts_stereo[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
164 
165  title.str("");
166  title << "PullGP_X_" << i+1 << "-" << j+1 << "_tr_stereo";
167  hPullGP_X_tr_stereo[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
168  title.str("");
169  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_tr_stereo";
170  hPullGP_Y_tr_stereo[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
171  title.str("");
172  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_tr_stereo";
173  hPullGP_Z_tr_stereo[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
174 
175  title.str("");
176  title << "PullGP_X_" << i+1 << "-" << j+1 << "_rs_stereo";
177  hPullGP_X_rs_stereo[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
178  title.str("");
179  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_rs_stereo";
180  hPullGP_Y_rs_stereo[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
181  title.str("");
182  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_rs_stereo";
183  hPullGP_Z_rs_stereo[title.str()] = new TH1F(title.str().c_str(),title.str().c_str(),1000,-50,50);
184  }
185  }
186  hTotChi2Increment = new TH1F("TotChi2Increment","TotChi2Increment",1000,0,100);
187  hProcess_vs_Chi2 = new TH2F("Process_vs_Chi2","Process_vs_Chi2",1000,0,100,17,-0.5,16.5);
188  hClsize_vs_Chi2 = new TH2F("Clsize_vs_Chi2","Clsize_vs_Chi2",1000,0,100,17,-0.5,16.5);
189 }
int i
Definition: DBlmapReader.cc:9
std::map< std::string, TH1F * > hPullGP_Y_tr_mono
Definition: TestHits.h:107
std::map< std::string, TH1F * > hPullGP_X_rs_mono
Definition: TestHits.h:103
std::map< std::string, TH1F * > hPullGP_Z_tr_stereo
Definition: TestHits.h:121
TH1F * hTotChi2Increment
Definition: TestHits.h:94
edm::ESHandle< TransientTrackingRecHitBuilder > theBuilder
Definition: TestHits.h:75
std::map< std::string, TH1F * > hPullGP_Z_ts_mono
Definition: TestHits.h:99
std::map< std::string, TH1F * > hPullGM_X_ts_stereo
Definition: TestHits.h:113
std::map< std::string, TH1F * > hPullGM_X_ts_mono
Definition: TestHits.h:100
std::string builderName
Definition: TestHits.h:68
std::map< std::string, TH1F * > hPullGP_Y_ts
Definition: TestHits.h:82
std::map< std::string, TH1F * > hChi2Increment
Definition: TestHits.h:93
std::map< std::string, TH1F * > hPullGP_Y_ts_stereo
Definition: TestHits.h:111
std::map< std::string, TH1F * > hPullGP_Z_rs
Definition: TestHits.h:89
edm::ESHandle< Propagator > thePropagator
Definition: TestHits.h:74
std::map< std::string, TH1F * > hPullGP_Y_rs
Definition: TestHits.h:88
std::map< std::string, TH1F * > hPullGP_X_tr_stereo
Definition: TestHits.h:119
std::map< std::string, TH1F * > hPullGP_Z_rs_stereo
Definition: TestHits.h:118
std::map< std::string, TH1F * > hPullGP_Y_tr
Definition: TestHits.h:91
std::string propagatorName
Definition: TestHits.h:67
std::map< std::string, TH1F * > hPullGP_X_rs_stereo
Definition: TestHits.h:116
int j
Definition: DBlmapReader.cc:9
std::map< std::string, TH1F * > hPullGP_Y_tr_stereo
Definition: TestHits.h:120
std::map< std::string, TH1F * > hPullGP_Y_rs_mono
Definition: TestHits.h:104
std::map< std::string, TH1F * > hPullGM_Z_ts
Definition: TestHits.h:86
std::map< std::string, TH1F * > hPullGM_Y_ts_mono
Definition: TestHits.h:101
std::map< std::string, TH1F * > hPullGP_Z_rs_mono
Definition: TestHits.h:105
std::map< std::string, TH1F * > hPullGP_X_ts_stereo
Definition: TestHits.h:110
std::map< std::string, TH1F * > hPullGP_Y_rs_stereo
Definition: TestHits.h:117
edm::ESHandle< TrackerGeometry > theG
Definition: TestHits.h:72
edm::ESHandle< TrajectoryFitter > fit
Definition: TestHits.h:76
std::map< std::string, TH1F * > hPullGM_Z_ts_stereo
Definition: TestHits.h:115
TH2F * hProcess_vs_Chi2
Definition: TestHits.h:95
const T & get() const
Definition: EventSetup.h:55
std::map< std::string, TH1F * > hPullGP_Z_tr
Definition: TestHits.h:92
std::map< std::string, TH1F * > hPullGP_Y_ts_mono
Definition: TestHits.h:98
std::map< std::string, TH1F * > hPullGM_Y_ts_stereo
Definition: TestHits.h:114
edm::ESHandle< MagneticField > theMF
Definition: TestHits.h:73
std::map< std::string, TH1F * > hPullGP_X_tr_mono
Definition: TestHits.h:106
TH2F * hClsize_vs_Chi2
Definition: TestHits.h:95
TFile * file
Definition: TestHits.h:79
std::map< std::string, TH1F * > hPullGM_X_ts
Definition: TestHits.h:84
std::map< std::string, TH1F * > hPullGP_X_ts
Definition: TestHits.h:81
std::string fname
Definition: TestHits.h:70
std::map< std::string, TH1F * > hPullGP_Z_ts
Definition: TestHits.h:83
std::map< std::string, TH1F * > hPullGP_Z_tr_mono
Definition: TestHits.h:108
std::map< std::string, TH1F * > hPullGP_X_ts_mono
Definition: TestHits.h:97
std::map< std::string, TH1F * > hPullGM_Z_ts_mono
Definition: TestHits.h:102
std::map< std::string, TH1F * > hPullGM_Y_ts
Definition: TestHits.h:85
std::map< std::string, TH1F * > hPullGP_X_tr
Definition: TestHits.h:90
std::stringstream title
Definition: TestHits.h:80
std::map< std::string, TH1F * > hPullGP_Z_ts_stereo
Definition: TestHits.h:112
std::map< std::string, TH1F * > hPullGP_X_rs
Definition: TestHits.h:87
void TestHits::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 944 of file TestHits.cc.

References file, hChi2Increment, hClsize_vs_Chi2, hProcess_vs_Chi2, hPullGM_X_ts, hPullGM_X_ts_mono, hPullGM_X_ts_stereo, hPullGM_Y_ts, hPullGM_Y_ts_mono, hPullGM_Y_ts_stereo, hPullGM_Z_ts, hPullGM_Z_ts_mono, hPullGM_Z_ts_stereo, hPullGP_X_rs, hPullGP_X_rs_mono, hPullGP_X_rs_stereo, hPullGP_X_tr, hPullGP_X_tr_mono, hPullGP_X_tr_stereo, hPullGP_X_ts, hPullGP_X_ts_mono, hPullGP_X_ts_stereo, hPullGP_Y_rs, hPullGP_Y_rs_mono, hPullGP_Y_rs_stereo, hPullGP_Y_tr, hPullGP_Y_tr_mono, hPullGP_Y_tr_stereo, hPullGP_Y_ts, hPullGP_Y_ts_mono, hPullGP_Y_ts_stereo, hPullGP_Z_rs, hPullGP_Z_rs_mono, hPullGP_Z_rs_stereo, hPullGP_Z_tr, hPullGP_Z_tr_mono, hPullGP_Z_tr_stereo, hPullGP_Z_ts, hPullGP_Z_ts_mono, hPullGP_Z_ts_stereo, hTotChi2Increment, i, j, and title.

944  {
945  //file->Write();
946  TDirectory * chi2i = file->mkdir("Chi2_Increment");
947 
948  TDirectory * gp_ts = file->mkdir("GP_TSOS-SimHit");
949  TDirectory * gm_ts = file->mkdir("GM_TSOS-SimHit");
950  TDirectory * gp_tr = file->mkdir("GP_TSOS-RecHit");
951  TDirectory * gp_rs = file->mkdir("GP_RecHit-SimHit");
952 
953  TDirectory * gp_tsx = gp_ts->mkdir("X");
954  TDirectory * gp_tsy = gp_ts->mkdir("Y");
955  TDirectory * gp_tsz = gp_ts->mkdir("Z");
956  TDirectory * gm_tsx = gm_ts->mkdir("X");
957  TDirectory * gm_tsy = gm_ts->mkdir("Y");
958  TDirectory * gm_tsz = gm_ts->mkdir("Z");
959  TDirectory * gp_trx = gp_tr->mkdir("X");
960  TDirectory * gp_try = gp_tr->mkdir("Y");
961  TDirectory * gp_trz = gp_tr->mkdir("Z");
962  TDirectory * gp_rsx = gp_rs->mkdir("X");
963  TDirectory * gp_rsy = gp_rs->mkdir("Y");
964  TDirectory * gp_rsz = gp_rs->mkdir("Z");
965 
966  TDirectory * gp_tsx_mono = gp_ts->mkdir("MONOX");
967  TDirectory * gp_tsy_mono = gp_ts->mkdir("MONOY");
968  TDirectory * gp_tsz_mono = gp_ts->mkdir("MONOZ");
969  TDirectory * gm_tsx_mono = gm_ts->mkdir("MONOX");
970  TDirectory * gm_tsy_mono = gm_ts->mkdir("MONOY");
971  TDirectory * gm_tsz_mono = gm_ts->mkdir("MONOZ");
972  TDirectory * gp_trx_mono = gp_tr->mkdir("MONOX");
973  TDirectory * gp_try_mono = gp_tr->mkdir("MONOY");
974  TDirectory * gp_trz_mono = gp_tr->mkdir("MONOZ");
975  TDirectory * gp_rsx_mono = gp_rs->mkdir("MONOX");
976  TDirectory * gp_rsy_mono = gp_rs->mkdir("MONOY");
977  TDirectory * gp_rsz_mono = gp_rs->mkdir("MONOZ");
978 
979  TDirectory * gp_tsx_stereo = gp_ts->mkdir("STEREOX");
980  TDirectory * gp_tsy_stereo = gp_ts->mkdir("STEREOY");
981  TDirectory * gp_tsz_stereo = gp_ts->mkdir("STEREOZ");
982  TDirectory * gm_tsx_stereo = gm_ts->mkdir("STEREOX");
983  TDirectory * gm_tsy_stereo = gm_ts->mkdir("STEREOY");
984  TDirectory * gm_tsz_stereo = gm_ts->mkdir("STEREOZ");
985  TDirectory * gp_trx_stereo = gp_tr->mkdir("STEREOX");
986  TDirectory * gp_try_stereo = gp_tr->mkdir("STEREOY");
987  TDirectory * gp_trz_stereo = gp_tr->mkdir("STEREOZ");
988  TDirectory * gp_rsx_stereo = gp_rs->mkdir("STEREOX");
989  TDirectory * gp_rsy_stereo = gp_rs->mkdir("STEREOY");
990  TDirectory * gp_rsz_stereo = gp_rs->mkdir("STEREOZ");
991 
992  chi2i->cd();
993  hTotChi2Increment->Write();
994  hProcess_vs_Chi2->Write();
995  hClsize_vs_Chi2->Write();
996  for (int i=0; i!=6; i++)
997  for (int j=0; j!=9; j++){
998  if (i==0 && j>2) break;
999  if (i==1 && j>1) break;
1000  if (i==2 && j>3) break;
1001  if (i==3 && j>2) break;
1002  if (i==4 && j>5) break;
1003  if (i==5 && j>8) break;
1004  chi2i->cd();
1005  title.str("");
1006  title << "Chi2Increment_" << i+1 << "-" << j+1;
1007  hChi2Increment[title.str()]->Write();
1008 
1009  gp_ts->cd();
1010  gp_tsx->cd();
1011  title.str("");
1012  title << "PullGP_X_" << i+1 << "-" << j+1 << "_ts";
1013  hPullGP_X_ts[title.str()]->Write();
1014  gp_tsy->cd();
1015  title.str("");
1016  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_ts";
1017  hPullGP_Y_ts[title.str()]->Write();
1018  gp_tsz->cd();
1019  title.str("");
1020  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_ts";
1021  hPullGP_Z_ts[title.str()]->Write();
1022 
1023  gm_ts->cd();
1024  gm_tsx->cd();
1025  title.str("");
1026  title << "PullGM_X_" << i+1 << "-" << j+1 << "_ts";
1027  hPullGM_X_ts[title.str()]->Write();
1028  gm_tsy->cd();
1029  title.str("");
1030  title << "PullGM_Y_" << i+1 << "-" << j+1 << "_ts";
1031  hPullGM_Y_ts[title.str()]->Write();
1032  gm_tsz->cd();
1033  title.str("");
1034  title << "PullGM_Z_" << i+1 << "-" << j+1 << "_ts";
1035  hPullGM_Z_ts[title.str()]->Write();
1036 
1037  gp_tr->cd();
1038  gp_trx->cd();
1039  title.str("");
1040  title << "PullGP_X_" << i+1 << "-" << j+1 << "_tr";
1041  hPullGP_X_tr[title.str()]->Write();
1042  gp_try->cd();
1043  title.str("");
1044  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_tr";
1045  hPullGP_Y_tr[title.str()]->Write();
1046  gp_trz->cd();
1047  title.str("");
1048  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_tr";
1049  hPullGP_Z_tr[title.str()]->Write();
1050 
1051  gp_rs->cd();
1052  gp_rsx->cd();
1053  title.str("");
1054  title << "PullGP_X_" << i+1 << "-" << j+1 << "_rs";
1055  hPullGP_X_rs[title.str()]->Write();
1056  gp_rsy->cd();
1057  title.str("");
1058  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_rs";
1059  hPullGP_Y_rs[title.str()]->Write();
1060  gp_rsz->cd();
1061  title.str("");
1062  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_rs";
1063  hPullGP_Z_rs[title.str()]->Write();
1064 
1065  if ( ((i==2||i==4)&&(j==0||j==1)) || (i==3||i==5) ){
1066  //mono
1067  gp_ts->cd();
1068  gp_tsx_mono->cd();
1069  title.str("");
1070  title << "PullGP_X_" << i+1 << "-" << j+1 << "_ts_mono";
1071  hPullGP_X_ts_mono[title.str()]->Write();
1072  gp_tsy_mono->cd();
1073  title.str("");
1074  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_ts_mono";
1075  hPullGP_Y_ts_mono[title.str()]->Write();
1076  gp_tsz_mono->cd();
1077  title.str("");
1078  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_ts_mono";
1079  hPullGP_Z_ts_mono[title.str()]->Write();
1080 
1081  gm_ts->cd();
1082  gm_tsx_mono->cd();
1083  title.str("");
1084  title << "PullGM_X_" << i+1 << "-" << j+1 << "_ts_mono";
1085  hPullGM_X_ts_mono[title.str()]->Write();
1086  gm_tsy_mono->cd();
1087  title.str("");
1088  title << "PullGM_Y_" << i+1 << "-" << j+1 << "_ts_mono";
1089  hPullGM_Y_ts_mono[title.str()]->Write();
1090  gm_tsz_mono->cd();
1091  title.str("");
1092  title << "PullGM_Z_" << i+1 << "-" << j+1 << "_ts_mono";
1093  hPullGM_Z_ts_mono[title.str()]->Write();
1094 
1095  gp_tr->cd();
1096  gp_trx_mono->cd();
1097  title.str("");
1098  title << "PullGP_X_" << i+1 << "-" << j+1 << "_tr_mono";
1099  hPullGP_X_tr_mono[title.str()]->Write();
1100  gp_try_mono->cd();
1101  title.str("");
1102  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_tr_mono";
1103  hPullGP_Y_tr_mono[title.str()]->Write();
1104  gp_trz_mono->cd();
1105  title.str("");
1106  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_tr_mono";
1107  hPullGP_Z_tr_mono[title.str()]->Write();
1108 
1109  gp_rs->cd();
1110  gp_rsx_mono->cd();
1111  title.str("");
1112  title << "PullGP_X_" << i+1 << "-" << j+1 << "_rs_mono";
1113  hPullGP_X_rs_mono[title.str()]->Write();
1114  gp_rsy_mono->cd();
1115  title.str("");
1116  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_rs_mono";
1117  hPullGP_Y_rs_mono[title.str()]->Write();
1118  gp_rsz_mono->cd();
1119  title.str("");
1120  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_rs_mono";
1121  hPullGP_Z_rs_mono[title.str()]->Write();
1122 
1123  //stereo
1124  gp_ts->cd();
1125  gp_tsx_stereo->cd();
1126  title.str("");
1127  title << "PullGP_X_" << i+1 << "-" << j+1 << "_ts_stereo";
1128  hPullGP_X_ts_stereo[title.str()]->Write();
1129  gp_tsy_stereo->cd();
1130  title.str("");
1131  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_ts_stereo";
1132  hPullGP_Y_ts_stereo[title.str()]->Write();
1133  gp_tsz_stereo->cd();
1134  title.str("");
1135  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_ts_stereo";
1136  hPullGP_Z_ts_stereo[title.str()]->Write();
1137 
1138  gm_ts->cd();
1139  gm_tsx_stereo->cd();
1140  title.str("");
1141  title << "PullGM_X_" << i+1 << "-" << j+1 << "_ts_stereo";
1142  hPullGM_X_ts_stereo[title.str()]->Write();
1143  gm_tsy_stereo->cd();
1144  title.str("");
1145  title << "PullGM_Y_" << i+1 << "-" << j+1 << "_ts_stereo";
1146  hPullGM_Y_ts_stereo[title.str()]->Write();
1147  gm_tsz_stereo->cd();
1148  title.str("");
1149  title << "PullGM_Z_" << i+1 << "-" << j+1 << "_ts_stereo";
1150  hPullGM_Z_ts_stereo[title.str()]->Write();
1151 
1152  gp_tr->cd();
1153  gp_trx_stereo->cd();
1154  title.str("");
1155  title << "PullGP_X_" << i+1 << "-" << j+1 << "_tr_stereo";
1156  hPullGP_X_tr_stereo[title.str()]->Write();
1157  gp_try_stereo->cd();
1158  title.str("");
1159  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_tr_stereo";
1160  hPullGP_Y_tr_stereo[title.str()]->Write();
1161  gp_trz_stereo->cd();
1162  title.str("");
1163  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_tr_stereo";
1164  hPullGP_Z_tr_stereo[title.str()]->Write();
1165 
1166  gp_rs->cd();
1167  gp_rsx_stereo->cd();
1168  title.str("");
1169  title << "PullGP_X_" << i+1 << "-" << j+1 << "_rs_stereo";
1170  hPullGP_X_rs_stereo[title.str()]->Write();
1171  gp_rsy_stereo->cd();
1172  title.str("");
1173  title << "PullGP_Y_" << i+1 << "-" << j+1 << "_rs_stereo";
1174  hPullGP_Y_rs_stereo[title.str()]->Write();
1175  gp_rsz_stereo->cd();
1176  title.str("");
1177  title << "PullGP_Z_" << i+1 << "-" << j+1 << "_rs_stereo";
1178  hPullGP_Z_rs_stereo[title.str()]->Write();
1179  }
1180  }
1181 
1182  file->Close();
1183 }
int i
Definition: DBlmapReader.cc:9
std::map< std::string, TH1F * > hPullGP_Y_tr_mono
Definition: TestHits.h:107
std::map< std::string, TH1F * > hPullGP_X_rs_mono
Definition: TestHits.h:103
std::map< std::string, TH1F * > hPullGP_Z_tr_stereo
Definition: TestHits.h:121
TH1F * hTotChi2Increment
Definition: TestHits.h:94
std::map< std::string, TH1F * > hPullGP_Z_ts_mono
Definition: TestHits.h:99
std::map< std::string, TH1F * > hPullGM_X_ts_stereo
Definition: TestHits.h:113
std::map< std::string, TH1F * > hPullGM_X_ts_mono
Definition: TestHits.h:100
std::map< std::string, TH1F * > hPullGP_Y_ts
Definition: TestHits.h:82
std::map< std::string, TH1F * > hChi2Increment
Definition: TestHits.h:93
std::map< std::string, TH1F * > hPullGP_Y_ts_stereo
Definition: TestHits.h:111
std::map< std::string, TH1F * > hPullGP_Z_rs
Definition: TestHits.h:89
std::map< std::string, TH1F * > hPullGP_Y_rs
Definition: TestHits.h:88
std::map< std::string, TH1F * > hPullGP_X_tr_stereo
Definition: TestHits.h:119
std::map< std::string, TH1F * > hPullGP_Z_rs_stereo
Definition: TestHits.h:118
std::map< std::string, TH1F * > hPullGP_Y_tr
Definition: TestHits.h:91
std::map< std::string, TH1F * > hPullGP_X_rs_stereo
Definition: TestHits.h:116
int j
Definition: DBlmapReader.cc:9
std::map< std::string, TH1F * > hPullGP_Y_tr_stereo
Definition: TestHits.h:120
std::map< std::string, TH1F * > hPullGP_Y_rs_mono
Definition: TestHits.h:104
std::map< std::string, TH1F * > hPullGM_Z_ts
Definition: TestHits.h:86
std::map< std::string, TH1F * > hPullGM_Y_ts_mono
Definition: TestHits.h:101
std::map< std::string, TH1F * > hPullGP_Z_rs_mono
Definition: TestHits.h:105
std::map< std::string, TH1F * > hPullGP_X_ts_stereo
Definition: TestHits.h:110
std::map< std::string, TH1F * > hPullGP_Y_rs_stereo
Definition: TestHits.h:117
std::map< std::string, TH1F * > hPullGM_Z_ts_stereo
Definition: TestHits.h:115
TH2F * hProcess_vs_Chi2
Definition: TestHits.h:95
std::map< std::string, TH1F * > hPullGP_Z_tr
Definition: TestHits.h:92
std::map< std::string, TH1F * > hPullGP_Y_ts_mono
Definition: TestHits.h:98
std::map< std::string, TH1F * > hPullGM_Y_ts_stereo
Definition: TestHits.h:114
std::map< std::string, TH1F * > hPullGP_X_tr_mono
Definition: TestHits.h:106
TH2F * hClsize_vs_Chi2
Definition: TestHits.h:95
TFile * file
Definition: TestHits.h:79
std::map< std::string, TH1F * > hPullGM_X_ts
Definition: TestHits.h:84
std::map< std::string, TH1F * > hPullGP_X_ts
Definition: TestHits.h:81
std::map< std::string, TH1F * > hPullGP_Z_ts
Definition: TestHits.h:83
std::map< std::string, TH1F * > hPullGP_Z_tr_mono
Definition: TestHits.h:108
std::map< std::string, TH1F * > hPullGP_X_ts_mono
Definition: TestHits.h:97
std::map< std::string, TH1F * > hPullGM_Z_ts_mono
Definition: TestHits.h:102
std::map< std::string, TH1F * > hPullGM_Y_ts
Definition: TestHits.h:85
std::map< std::string, TH1F * > hPullGP_X_tr
Definition: TestHits.h:90
std::stringstream title
Definition: TestHits.h:80
std::map< std::string, TH1F * > hPullGP_Z_ts_stereo
Definition: TestHits.h:112
std::map< std::string, TH1F * > hPullGP_X_rs
Definition: TestHits.h:87
std::pair< LocalPoint, LocalVector > TestHits::projectHit ( const PSimHit hit,
const StripGeomDetUnit stripDet,
const BoundPlane plane 
)
private

Definition at line 1188 of file TestHits.cc.

References funct::cos(), dir, PSimHit::localDirection(), PSimHit::localPosition(), pileupReCalc_HLTpaths::scale, funct::sin(), StripGeomDetUnit::specificTopology(), StripTopology::strip(), StripTopology::stripAngle(), GeomDet::surface(), Surface::toGlobal(), GloballyPositioned< T >::toLocal(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by analyze().

1189 {
1190  const StripTopology& topol = stripDet->specificTopology();
1191  GlobalPoint globalpos= stripDet->surface().toGlobal(hit.localPosition());
1192  LocalPoint localHit = plane.toLocal(globalpos);
1193  //track direction
1194  LocalVector locdir=hit.localDirection();
1195  //rotate track in new frame
1196 
1197  GlobalVector globaldir= stripDet->surface().toGlobal(locdir);
1198  LocalVector dir=plane.toLocal(globaldir);
1199  float scale = -localHit.z() / dir.z();
1200 
1201  LocalPoint projectedPos = localHit + scale*dir;
1202 
1203  float selfAngle = topol.stripAngle( topol.strip( hit.localPosition()));
1204 
1205  LocalVector stripDir( sin(selfAngle), cos(selfAngle), 0); // vector along strip in hit frame
1206 
1207  LocalVector localStripDir( plane.toLocal(stripDet->surface().toGlobal( stripDir)));
1208 
1209  return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
1210 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
virtual float stripAngle(float strip) const =0
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
virtual float strip(const LocalPoint &) const =0
Local3DPoint localPosition() const
Definition: PSimHit.h:44
LocalPoint toLocal(const GlobalPoint &gp) const
T z() const
Definition: PV3DBase.h:63
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
LocalVector localDirection() const
Obsolete. Same as momentumAtEntry().unit(), for backward compatibility.
Definition: PSimHit.h:52
const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
dbl *** dir
Definition: mlp_gen.cc:35

Member Data Documentation

std::string TestHits::builderName
private

Definition at line 68 of file TestHits.h.

Referenced by beginRun(), and TestHits().

const edm::ParameterSet TestHits::conf_
private

Definition at line 62 of file TestHits.h.

Referenced by TestHits().

TFile* TestHits::file
private

Definition at line 79 of file TestHits.h.

Referenced by beginRun(), and endJob().

edm::ESHandle<TrajectoryFitter> TestHits::fit
private

Definition at line 76 of file TestHits.h.

Referenced by analyze(), and beginRun().

std::string TestHits::fname
private

Definition at line 70 of file TestHits.h.

Referenced by beginRun(), and TestHits().

std::map<std::string,TH1F*> TestHits::hChi2Increment
private

Definition at line 93 of file TestHits.h.

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

TH2F * TestHits::hClsize_vs_Chi2
private

Definition at line 95 of file TestHits.h.

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

TrackerHitAssociator* TestHits::hitAssociator
private

Definition at line 63 of file TestHits.h.

Referenced by analyze().

TH2F* TestHits::hProcess_vs_Chi2
private

Definition at line 95 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGM_X_ts
private

Definition at line 84 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGM_X_ts_mono
private

Definition at line 100 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGM_X_ts_stereo
private

Definition at line 113 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGM_Y_ts
private

Definition at line 85 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGM_Y_ts_mono
private

Definition at line 101 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGM_Y_ts_stereo
private

Definition at line 114 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGM_Z_ts
private

Definition at line 86 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGM_Z_ts_mono
private

Definition at line 102 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGM_Z_ts_stereo
private

Definition at line 115 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_X_rs
private

Definition at line 87 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_X_rs_mono
private

Definition at line 103 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_X_rs_stereo
private

Definition at line 116 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_X_tr
private

Definition at line 90 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_X_tr_mono
private

Definition at line 106 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_X_tr_stereo
private

Definition at line 119 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_X_ts
private

Definition at line 81 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_X_ts_mono
private

Definition at line 97 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_X_ts_stereo
private

Definition at line 110 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Y_rs
private

Definition at line 88 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Y_rs_mono
private

Definition at line 104 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Y_rs_stereo
private

Definition at line 117 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Y_tr
private

Definition at line 91 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Y_tr_mono
private

Definition at line 107 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Y_tr_stereo
private

Definition at line 120 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Y_ts
private

Definition at line 82 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Y_ts_mono
private

Definition at line 98 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Y_ts_stereo
private

Definition at line 111 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Z_rs
private

Definition at line 89 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Z_rs_mono
private

Definition at line 105 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Z_rs_stereo
private

Definition at line 118 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Z_tr
private

Definition at line 92 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Z_tr_mono
private

Definition at line 108 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Z_tr_stereo
private

Definition at line 121 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Z_ts
private

Definition at line 83 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Z_ts_mono
private

Definition at line 99 of file TestHits.h.

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

std::map<std::string,TH1F*> TestHits::hPullGP_Z_ts_stereo
private

Definition at line 112 of file TestHits.h.

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

TH1F* TestHits::hTotChi2Increment
private

Definition at line 94 of file TestHits.h.

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

double TestHits::maxeta
private

Definition at line 65 of file TestHits.h.

Referenced by analyze(), and TestHits().

double TestHits::mineta
private

Definition at line 65 of file TestHits.h.

Referenced by analyze(), and TestHits().

std::string TestHits::propagatorName
private

Definition at line 67 of file TestHits.h.

Referenced by beginRun(), and TestHits().

std::string TestHits::srcName
private

Definition at line 69 of file TestHits.h.

Referenced by analyze(), and TestHits().

edm::ESHandle<TransientTrackingRecHitBuilder> TestHits::theBuilder
private

Definition at line 75 of file TestHits.h.

Referenced by analyze(), and beginRun().

edm::ESHandle<TrackerGeometry> TestHits::theG
private

Definition at line 72 of file TestHits.h.

Referenced by analyze(), and beginRun().

edm::ESHandle<MagneticField> TestHits::theMF
private

Definition at line 73 of file TestHits.h.

Referenced by analyze(), and beginRun().

edm::ESHandle<Propagator> TestHits::thePropagator
private

Definition at line 74 of file TestHits.h.

Referenced by analyze(), and beginRun().

edm::Handle<TrackCandidateCollection> TestHits::theTCCollection
private

Definition at line 77 of file TestHits.h.

Referenced by analyze().

std::stringstream TestHits::title
private