CMS 3D CMS Logo

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 edm::EDConsumerBase

Public Member Functions

 TestHits (const edm::ParameterSet &)
 
 ~TestHits ()
 
- 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 ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

std::string builderName
 
TFile * file
 
edm::ESHandle< TrajectoryFitterfit
 
std::string fname
 
std::map< std::string, TH1F * > hChi2Increment
 
TH2F * hClsize_vs_Chi2
 
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< TransientTrackingRecHitBuildertheBuilder
 
edm::ESHandle< TrackerGeometrytheG
 
edm::ESHandle< MagneticFieldtheMF
 
edm::ESHandle< PropagatorthePropagator
 
edm::Handle< TrackCandidateCollectiontheTCCollection
 
std::stringstream title
 
TrackerHitAssociator::Config trackerHitAssociatorConfig_
 

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

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 24 of file TestHits.cc.

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

24  :
26  LogTrace("TestHits") << iConfig<< std::endl;
27  propagatorName = iConfig.getParameter<std::string>("Propagator");
28  builderName = iConfig.getParameter<std::string>("TTRHBuilder");
29  srcName = iConfig.getParameter<std::string>("src");
30  fname = iConfig.getParameter<std::string>("Fitter");
31  mineta = iConfig.getParameter<double>("mineta");
32  maxeta = iConfig.getParameter<double>("maxeta");
33 }
T getParameter(std::string const &) const
std::string builderName
Definition: TestHits.h:67
double mineta
Definition: TestHits.h:64
TrackerHitAssociator::Config trackerHitAssociatorConfig_
Definition: TestHits.h:62
std::string propagatorName
Definition: TestHits.h:66
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
#define LogTrace(id)
std::string fname
Definition: TestHits.h:69
std::string srcName
Definition: TestHits.h:68
double maxeta
Definition: TestHits.h:64
TestHits::~TestHits ( )

Definition at line 35 of file TestHits.cc.

35 {}

Member Function Documentation

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

Definition at line 188 of file TestHits.cc.

References TrackerHitAssociator::associateHit(), TransientTrackingRecHitBuilder::build(), TrajectoryStateOnSurface::cartesianError(), GlobalErrorBase< T, ErrorWeightType >::cxx(), GlobalErrorBase< T, ErrorWeightType >::cyy(), GlobalErrorBase< T, ErrorWeightType >::czz(), delta, DetId::det(), PTrajectoryStateOnDet::detId(), edm::EventSetup::get(), edm::Event::getByLabel(), TrajectoryStateOnSurface::globalMomentum(), TrajectoryStateOnSurface::globalPosition(), hChi2Increment, hClsize_vs_Chi2, TrackQuality_cff::hitAssociator, hfClusterShapes_cfi::hits, 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, TrackerGeometry::idToDet(), TrajectoryStateOnSurface::isValid(), TrackerTopology::layer(), PSimHit::localPosition(), LogTrace, funct::m, mag(), CartesianTrajectoryError::matrix(), maxeta, mineta, PSimHit::momentumAtEntry(), GloballyPositioned< T >::position(), CartesianTrajectoryError::position(), PSimHit::processType(), edm::ESHandle< T >::product(), projectHit(), Propagator::propagate(), TrackCandidate::recHits(), mps_fire::result, alignCSCRings::s, TrackCandidate::seed(), mathSSE::sqrt(), srcName, GeomDet::surface(), theBuilder, theG, theMF, thePropagator, theTCCollection, title, Surface::toGlobal(), trackerHitAssociatorConfig_, TrackCandidate::trajectoryStateOnDet(), trajectoryStateTransform::transientState(), TrackInfoProducer_cfi::updatedState, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

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

Definition at line 37 of file TestHits.cc.

References builderName, file, 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.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 937 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.

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

Definition at line 1181 of file TestHits.cc.

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

Referenced by analyze().

1182 {
1183  const StripTopology& topol = stripDet->specificTopology();
1184  GlobalPoint globalpos= stripDet->surface().toGlobal(hit.localPosition());
1185  LocalPoint localHit = plane.toLocal(globalpos);
1186  //track direction
1187  LocalVector locdir=hit.localDirection();
1188  //rotate track in new frame
1189 
1190  GlobalVector globaldir= stripDet->surface().toGlobal(locdir);
1191  LocalVector dir=plane.toLocal(globaldir);
1192  float scale = -localHit.z() / dir.z();
1193 
1194  LocalPoint projectedPos = localHit + scale*dir;
1195 
1196  float selfAngle = topol.stripAngle( topol.strip( hit.localPosition()));
1197 
1198  LocalVector stripDir( sin(selfAngle), cos(selfAngle), 0); // vector along strip in hit frame
1199 
1200  LocalVector localStripDir( plane.toLocal(stripDet->surface().toGlobal( stripDir)));
1201 
1202  return std::pair<LocalPoint,LocalVector>( projectedPos, localStripDir);
1203 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:106
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
virtual float strip(const LocalPoint &) const =0
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
Local3DPoint localPosition() const
Definition: PSimHit.h:44
virtual float stripAngle(float strip) const =0
T z() const
Definition: PV3DBase.h:64
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
dbl *** dir
Definition: mlp_gen.cc:35

Member Data Documentation

std::string TestHits::builderName
private

Definition at line 67 of file TestHits.h.

Referenced by beginRun(), and TestHits().

TFile* TestHits::file
private

Definition at line 78 of file TestHits.h.

Referenced by beginRun(), and endJob().

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

Definition at line 75 of file TestHits.h.

Referenced by trackingPlots.Iteration::modules().

std::string TestHits::fname
private

Definition at line 69 of file TestHits.h.

Referenced by beginRun(), and TestHits().

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

Definition at line 92 of file TestHits.h.

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

TH2F * TestHits::hClsize_vs_Chi2
private

Definition at line 94 of file TestHits.h.

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

TH2F* TestHits::hProcess_vs_Chi2
private

Definition at line 94 of file TestHits.h.

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

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

Definition at line 83 of file TestHits.h.

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

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

Definition at line 99 of file TestHits.h.

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

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

Definition at line 112 of file TestHits.h.

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

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

Definition at line 84 of file TestHits.h.

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

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

Definition at line 100 of file TestHits.h.

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

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

Definition at line 113 of file TestHits.h.

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

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

Definition at line 85 of file TestHits.h.

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

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

Definition at line 101 of file TestHits.h.

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

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

Definition at line 114 of file TestHits.h.

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

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

Definition at line 86 of file TestHits.h.

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

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

Definition at line 102 of file TestHits.h.

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

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

Definition at line 115 of file TestHits.h.

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

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

Definition at line 89 of file TestHits.h.

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

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

Definition at line 105 of file TestHits.h.

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

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

Definition at line 118 of file TestHits.h.

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

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

Definition at line 80 of file TestHits.h.

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

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

Definition at line 96 of file TestHits.h.

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

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

Definition at line 109 of file TestHits.h.

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

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

Definition at line 87 of file TestHits.h.

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

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

Definition at line 103 of file TestHits.h.

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

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

Definition at line 116 of file TestHits.h.

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

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

Definition at line 90 of file TestHits.h.

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

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

Definition at line 106 of file TestHits.h.

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

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

Definition at line 119 of file TestHits.h.

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

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

Definition at line 81 of file TestHits.h.

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

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

Definition at line 97 of file TestHits.h.

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

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

Definition at line 110 of file TestHits.h.

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

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

Definition at line 88 of file TestHits.h.

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

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

Definition at line 104 of file TestHits.h.

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

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

Definition at line 117 of file TestHits.h.

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

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

Definition at line 91 of file TestHits.h.

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

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

Definition at line 107 of file TestHits.h.

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

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

Definition at line 120 of file TestHits.h.

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

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

Definition at line 82 of file TestHits.h.

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

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

Definition at line 98 of file TestHits.h.

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

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

Definition at line 111 of file TestHits.h.

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

TH1F* TestHits::hTotChi2Increment
private

Definition at line 93 of file TestHits.h.

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

double TestHits::maxeta
private

Definition at line 64 of file TestHits.h.

Referenced by analyze(), and TestHits().

double TestHits::mineta
private

Definition at line 64 of file TestHits.h.

Referenced by analyze(), and TestHits().

std::string TestHits::propagatorName
private

Definition at line 66 of file TestHits.h.

Referenced by beginRun(), and TestHits().

std::string TestHits::srcName
private

Definition at line 68 of file TestHits.h.

Referenced by analyze(), and TestHits().

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

Definition at line 74 of file TestHits.h.

Referenced by analyze(), and beginRun().

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

Definition at line 71 of file TestHits.h.

Referenced by analyze(), and beginRun().

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

Definition at line 72 of file TestHits.h.

Referenced by analyze(), and beginRun().

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

Definition at line 73 of file TestHits.h.

Referenced by analyze(), and beginRun().

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

Definition at line 76 of file TestHits.h.

Referenced by analyze().

std::stringstream TestHits::title
private
TrackerHitAssociator::Config TestHits::trackerHitAssociatorConfig_
private

Definition at line 62 of file TestHits.h.

Referenced by analyze().