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

#include <RecoTracker/DebugTools/plugins/TestOutliers.cc>

Inheritance diagram for TestOutliers:
edm::EDAnalyzer

Public Member Functions

 TestOutliers (const edm::ParameterSet &)
 
 ~TestOutliers ()
 
- 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 ()
 

Private Attributes

TH1F * badcluster
 
TH1F * badhittype
 
TH1F * badlayer
 
TH1F * badprocess
 
TH1F * countOldT
 
TH1F * countOutA
 
TH1F * countOutT
 
TH1F * deltahits
 
TH1F * deltahitsAssocGained
 
TH1F * deltahitsAssocLost
 
TH1F * deltahitsNO
 
TH1F * deltahitsOK
 
TH1F * energyLoss
 
TH1F * energyLossMax
 
TH1F * energyLossRatio
 
TFile * file
 
TH1F * gainedhits
 
TH1F * gainedhits2
 
TH1F * goodbadhits
 
TH1F * goodbadmerged
 
TH1F * goodbadmergedGained
 
TH1F * goodbadmergedLost
 
TH1F * goodcluster
 
TH1F * goodhittype
 
TH1F * goodhittype_clgteq4
 
TH1F * goodhittype_cllt4
 
TH1F * goodhittype_simvecbig
 
TH1F * goodhittype_simvecsmall
 
TH1F * goodlayer
 
TH1F * goodlayer_clgteq4
 
TH1F * goodlayer_cllt4
 
TH1F * goodlayer_simvecbig
 
TH1F * goodlayer_simvecsmall
 
TH1F * goodpix_clustersize
 
TH1F * goodpix_simvecsize
 
TH1F * goodpixgteq4_simvecsize
 
TH1F * goodpixlt4_simvecsize
 
TH1F * goodprj_clustersize
 
TH1F * goodprj_simvecsize
 
TH1F * goodprjgteq4_simvecsize
 
TH1F * goodprjlt4_simvecsize
 
TH1F * goodprocess
 
TH1F * goodst1_clustersize
 
TH1F * goodst1_simvecsize
 
TH1F * goodst1gteq4_simvecsize
 
TH1F * goodst1lt4_simvecsize
 
TH1F * goodst2_clustersize
 
TH1F * goodst2_simvecsize
 
TH1F * goodst2gteq4_simvecsize
 
TH1F * goodst2lt4_simvecsize
 
TH1F * histoD0Old
 
TH1F * histoD0Out
 
TH1F * histoDzOld
 
TH1F * histoDzOut
 
TH1F * histoLambdaOld
 
TH1F * histoLambdaOut
 
TH1F * histoPhiOld
 
TH1F * histoPhiOut
 
TH1F * histoPtOld
 
TH1F * histoPtOut
 
TH1F * histoQoverpOld
 
TH1F * histoQoverpOut
 
TrackerHitAssociatorhitAssociator
 
TH1F * hitsPerTrackAssocGained
 
TH1F * hitsPerTrackAssocLost
 
TH1F * hitsPerTrackGained
 
TH1F * hitsPerTrackLost
 
TH1F * mergedcluster
 
TH1F * mergedhittype
 
TH1F * mergedlayer
 
TH1F * mergedPull
 
TH1F * nOfTrackIds
 
TH1F * okcutsOld
 
TH1F * okcutsOut
 
std::string out
 
TH2F * posxy
 
TH2F * poszr
 
TH1F * probXbad
 
TH1F * probXdelta
 
TH1F * probXgood
 
TH1F * probXnoshare
 
TH1F * probXshared
 
TH1F * probYbad
 
TH1F * probYdelta
 
TH1F * probYgood
 
TH1F * probYnoshare
 
TH1F * probYshared
 
TH1F * process
 
edm::ParameterSet psetold
 
edm::ParameterSet psetout
 
TH1F * sizeOld
 
TH1F * sizeOldT
 
TH1F * sizeOut
 
TH1F * sizeOutT
 
TrackAssociatorBasetheAssociatorOld
 
TrackAssociatorBasetheAssociatorOut
 
edm::ESHandle< TrackerGeometrytheG
 
edm::InputTag tpTags_
 
TH1F * tracks
 
edm::InputTag trackTagsOld_
 
edm::InputTag trackTagsOut_
 

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 62 of file TestOutliers.cc.

Constructor & Destructor Documentation

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

Definition at line 129 of file TestOutliers.cc.

References edm::ParameterSet::getParameter(), LogTrace, psetold, and psetout.

130  :
131  trackTagsOut_(iConfig.getUntrackedParameter<edm::InputTag>("tracksOut")),
132  trackTagsOld_(iConfig.getUntrackedParameter<edm::InputTag>("tracksOld")),
134  out(iConfig.getParameter<std::string>("out"))
135 {
136  LogTrace("TestOutliers") <<"constructor";
137 // ParameterSet cuts = iConfig.getParameter<ParameterSet>("RecoTracksCuts");
138 // selectRecoTracks = RecoTrackSelector(cuts.getParameter<double>("ptMin"),
139 // cuts.getParameter<double>("minRapidity"),
140 // cuts.getParameter<double>("maxRapidity"),
141 // cuts.getParameter<double>("tip"),
142 // cuts.getParameter<double>("lip"),
143 // cuts.getParameter<int>("minHit"),
144 // cuts.getParameter<double>("maxChi2"));
145 
146  psetold = iConfig.getParameter<ParameterSet>("TrackAssociatorByHitsPSetOld");
147  psetout = iConfig.getParameter<ParameterSet>("TrackAssociatorByHitsPSetOut");
148  LogTrace("TestOutliers") <<"end constructor";
149 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
edm::ParameterSet psetold
std::string out
Definition: TestOutliers.cc:82
edm::ParameterSet psetout
edm::InputTag trackTagsOut_
Definition: TestOutliers.cc:74
#define LogTrace(id)
edm::InputTag tpTags_
Definition: TestOutliers.cc:76
edm::InputTag trackTagsOld_
Definition: TestOutliers.cc:75
TestOutliers::~TestOutliers ( )

Definition at line 152 of file TestOutliers.cc.

153 {
154 
155  // do anything here that needs to be done at desctruction time
156  // (e.g. close files, deallocate resources etc.)
157 
158 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 167 of file TestOutliers.cc.

References abs, TrackerHitAssociator::associateHit(), TrackerHitAssociator::associateHitId(), TrackAssociatorBase::associateRecoToSim(), badcluster, badhittype, badlayer, badprocess, SiPixelRawToDigiRegional_cfi::beamSpot, reco::TrackBase::charge(), TrajectoryStateClosestToPoint::charge(), funct::cos(), prof2calltree::count, countOldT, countOutA, countOutT, reco::TrackBase::d0(), reco::TrackBase::d0Error(), delta, deltahits, deltahitsAssocGained, deltahitsAssocLost, deltahitsNO, deltahitsOK, reco::TrackBase::dsz(), reco::TrackBase::dxy(), reco::TrackBase::dz(), reco::TrackBase::dzError(), energyLoss, energyLossMax, energyLossRatio, reco::TrackBase::eta(), spr::find(), first, gainedhits, gainedhits2, edm::EventSetup::get(), edm::RefToBase< T >::get(), edm::Ref< C, T, F >::get(), edm::Event::getByLabel(), goodbadhits, goodbadmerged, goodbadmergedGained, goodbadmergedLost, goodcluster, goodhittype, goodhittype_clgteq4, goodhittype_cllt4, goodhittype_simvecbig, goodhittype_simvecsmall, goodlayer, goodlayer_clgteq4, goodlayer_cllt4, goodlayer_simvecbig, goodlayer_simvecsmall, goodpix_clustersize, goodpix_simvecsize, goodpixgteq4_simvecsize, goodpixlt4_simvecsize, goodprj_clustersize, goodprj_simvecsize, goodprjgteq4_simvecsize, goodprjlt4_simvecsize, goodprocess, goodst1_clustersize, goodst1_simvecsize, goodst1gteq4_simvecsize, goodst1lt4_simvecsize, goodst2_clustersize, goodst2_simvecsize, goodst2gteq4_simvecsize, goodst2lt4_simvecsize, histoD0Old, histoD0Out, histoDzOld, histoDzOut, histoLambdaOld, histoLambdaOut, histoPhiOld, histoPhiOut, histoPtOld, histoPtOut, histoQoverpOld, histoQoverpOut, hitAssociator, hitsPerTrackAssocGained, hitsPerTrackAssocLost, hitsPerTrackGained, hitsPerTrackLost, edm::EventBase::id(), errorMatrix2Lands_multiChannel::id, j, findQualityFiles::jj, gen::k, reco::TrackBase::lambda(), LogTrace, m, M_PI, PV3DBase< T, PVType, FrameType >::mag(), makeMuonMisalignmentScenario::matrix, mergedcluster, mergedhittype, mergedlayer, mergedPull, CoreSimTrack::momentum(), FreeTrajectoryState::momentum(), nOfTrackIds, reco::TrackBase::normalizedChi2(), reco::TrackBase::numberOfValidHits(), AlCaHLTBitMon_ParallelJobs::p, PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), reco::TrackBase::phi(), reco::TrackBase::phiError(), FreeTrajectoryState::position(), posxy, poszr, SiPixelRecHit::probabilityX(), SiPixelRecHit::probabilityY(), probXbad, probXdelta, probXgood, probXnoshare, probXshared, probYbad, probYdelta, probYgood, probYnoshare, probYshared, process, PSimHit::processType(), edm::ESHandle< class >::product(), psetold, psetout, reco::TrackBase::pt(), reco::TrackBase::ptError(), reco::TrackBase::qoverp(), reco::TrackBase::qoverpError(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), reco::Track::seedRef(), funct::sin(), sizeOld, sizeOldT, sizeOut, sizeOutT, TrackingRecHit::some, python.multivaluedict::sort(), mathSSE::sqrt(), theAssociatorOld, theAssociatorOut, theG, TrajectoryStateClosestToPoint::theState(), PV3DBase< T, PVType, FrameType >::theta(), reco::TrackBase::thetaError(), tmp, tpTags_, TrackAssociatorByHits_cfi::TrackAssociatorByHits, tracks, trackTagsOld_, trackTagsOut_, ErrorFrameTransformer::transform(), v, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

167  {
168 
169  using namespace edm;
170  using namespace std;
171  using reco::TrackCollection;
172 
173  LogTrace("TestOutliers") <<"analyze event #" << iEvent.id();
174 
176  iEvent.getByLabel(trackTagsOut_,tracksOut);
178  iEvent.getByLabel(trackTagsOld_,tracksOld);
180  iEvent.getByLabel(tpTags_,tps);
182  iEvent.getByLabel("offlineBeamSpot",beamSpot);
183 
184  hitAssociator = new TrackerHitAssociator(iEvent);
185 
188  reco::RecoToSimCollection recSimCollOut=theAssociatorOut->associateRecoToSim(tracksOut, tps, &iEvent);
189  reco::RecoToSimCollection recSimCollOld=theAssociatorOld->associateRecoToSim(tracksOld, tps, &iEvent);
190  sizeOut->Fill(recSimCollOut.size());
191  sizeOld->Fill(recSimCollOld.size());
192  sizeOutT->Fill(tracksOut->size());
193  sizeOldT->Fill(tracksOld->size());
194 
195  LogTrace("TestOutliers") << "tOld size=" << tracksOld->size() << " tOut size=" << tracksOut->size()
196  << " aOld size=" << recSimCollOld.size() << " aOut size=" << recSimCollOut.size();
197 
198 #if 0
199  LogTrace("TestOutliers") << "recSimCollOld.size()=" << recSimCollOld.size() ;
200  for(reco::TrackCollection::size_type j=0; j<tracksOld->size(); ++j){
201  reco::TrackRef trackOld(tracksOld, j);
202  //if ( !selectRecoTracks( *trackOld,beamSpot.product() ) ) continue;
203  LogTrace("TestOutliers") << "trackOld->pt()=" << trackOld->pt() << " trackOld->numberOfValidHits()=" << trackOld->numberOfValidHits();
204  std::vector<pair<TrackingParticleRef, double> > tpOld;
205  if(recSimCollOld.find(trackOld) != recSimCollOld.end()){
206  tpOld = recSimCollOld[trackOld];
207  if (tpOld.size()!=0) LogTrace("TestOutliers") << " associated" ;
208  else LogTrace("TestOutliers") << " NOT associated" ;
209  } else LogTrace("TestOutliers") << " NOT associated" ;
210  }
211  LogTrace("TestOutliers") << "recSimCollOut.size()=" << recSimCollOut.size() ;
212  for(reco::TrackCollection::size_type j=0; j<tracksOut->size(); ++j){
213  reco::TrackRef trackOut(tracksOut, j);
214  //if ( !selectRecoTracks( *trackOut,beamSpot.product() ) ) continue;
215  LogTrace("TestOutliers") << "trackOut->pt()=" << trackOut->pt() << " trackOut->numberOfValidHits()=" << trackOut->numberOfValidHits();
216  std::vector<pair<TrackingParticleRef, double> > tpOut;
217  if(recSimCollOut.find(trackOut) != recSimCollOut.end()){
218  tpOut = recSimCollOut[trackOut];
219  if (tpOut.size()!=0) LogTrace("TestOutliers") << " associated" ;
220  else LogTrace("TestOutliers") << " NOT associated" ;
221  } else LogTrace("TestOutliers") << " NOT associated" ;
222  }
223 #endif
224 
225  LogTrace("TestOutliers") <<"tracksOut->size()="<<tracksOut->size();
226  LogTrace("TestOutliers") <<"tracksOld->size()="<<tracksOld->size();
227 
228  std::vector<unsigned int> outused;
229  for(unsigned int j=0; j<tracksOld->size(); ++j) {
230  countOldT->Fill(1);
231  edm::RefToBase<reco::Track> trackOld(tracksOld, j);
232  LogTrace("TestOutliers") << "now track old with id=" << j << " seed ref=" << trackOld->seedRef().get() << " pt=" << trackOld->pt()
233  << " eta=" << trackOld->eta() << " chi2=" << trackOld->normalizedChi2()
234  << " tip= " << fabs(trackOld->dxy(beamSpot->position()))
235  << " lip= " << fabs(trackOld->dsz(beamSpot->position()));
236 
237  // if (i==tracksOut->size()) {
238  // if(recSimCollOld.find(trackOld) != recSimCollOld.end()){
239  // vector<pair<TrackingParticleRef, double> > tpOld;
240  // tpOld = recSimCollOld[trackOld];
241  // if (tpOld.size()!=0) {
242  // LogTrace("TestOutliers") <<"no match: old associated and out lost! old has #hits=" << trackOld->numberOfValidHits()
243  // << " and fraction=" << tpOld.begin()->second;
244  // if (tpOld.begin()->second>0.5) hitsPerTrackLost->Fill(trackOld->numberOfValidHits());
245  // }
246  // }
247  // continue;
248  // }
249 
250  std::vector<unsigned int> outtest;//all the out tracks with the same seed ref
251  for(unsigned int k=0; k<tracksOut->size(); ++k) {
253  if ( tmpOut->seedRef() == trackOld->seedRef() ) {
254  outtest.push_back(k);
255  }
256  }
257 
259  if (outtest.size()==1) {// if only one that's it
260  trackOut = edm::RefToBase<reco::Track>(tracksOut, outtest[0]);
261  LogTrace("TestOutliers") << "now track out with id=" << outtest[0] << " seed ref=" << trackOut->seedRef().get() << " pt=" << trackOut->pt();
262  outused.push_back(outtest[0]);
263  } else if (outtest.size()>1) {//if > 1 take the one that shares all the hits with the old track
264  for(unsigned int p=0; p<outtest.size(); ++p) {
265  edm::RefToBase<reco::Track> tmpOut = edm::RefToBase<reco::Track>(tracksOut, outtest[p]);
266  bool allhits = true;
267  for (trackingRecHit_iterator itOut = tmpOut->recHitsBegin(); itOut!=tmpOut->recHitsEnd(); itOut++) {
268  if ((*itOut)->isValid()) {
269  bool thishit = false;
270  for (trackingRecHit_iterator itOld = trackOld->recHitsBegin(); itOld!=trackOld->recHitsEnd(); itOld++) {
271  if ((*itOld)->isValid()) {
272  const TrackingRecHit* kt = &(**itOld);
273  if ( (*itOut)->sharesInput(kt,TrackingRecHit::some) ) {
274  thishit = true;
275  break;
276  }
277  }
278  }
279  if (!thishit) allhits = false;
280  }
281  }
282  if (allhits) {
283  trackOut = edm::RefToBase<reco::Track>(tracksOut, outtest[p]);
284  LogTrace("TestOutliers") << "now track out with id=" << outtest[p] << " seed ref=" << trackOut->seedRef().get() << " pt=" << trackOut->pt();
285  outused.push_back(outtest[p]);
286  }
287  }
288  }
289 
290  if (outtest.size()==0 || trackOut.get()==0 ) {//no out track found for the old track
291  if(recSimCollOld.find(trackOld) != recSimCollOld.end()){
292  vector<pair<TrackingParticleRef, double> > tpOld;
293  tpOld = recSimCollOld[trackOld];
294  if (tpOld.size()!=0) {
295  LogTrace("TestOutliers") <<"no match: old associated and out lost! old has #hits=" << trackOld->numberOfValidHits()
296  << " and fraction=" << tpOld.begin()->second;
297  if (tpOld.begin()->second>0.5) hitsPerTrackLost->Fill(trackOld->numberOfValidHits());
298  }
299  }
300  LogTrace("TestOutliers") <<"...skip to next old track";
301  continue;
302  }
303 
304  //look if old and out are associated
305  LogTrace("TestOutliers") <<"trackOut->seedRef()=" << trackOut->seedRef().get() << " trackOld->seedRef()=" << trackOld->seedRef().get();
306  bool oldAssoc = recSimCollOld.find(trackOld) != recSimCollOld.end();
307  bool outAssoc = recSimCollOut.find(trackOut) != recSimCollOut.end();
308  LogTrace("TestOutliers") <<"outAssoc=" << outAssoc <<" oldAssoc=" << oldAssoc;
309 
310  // if ( trackOut->seedRef()!= trackOld->seedRef() ||
311  // (trackOut->seedRef() == trackOld->seedRef() && trackOut->numberOfValidHits()>trackOld->numberOfValidHits()) ) {
312  // LogTrace("TestOutliers") <<"out and old tracks does not match...";
313  // LogTrace("TestOutliers") <<"old has #hits=" << trackOld->numberOfValidHits();
314  // std::vector<pair<TrackingParticleRef, double> > tpOld;
315  // if(recSimCollOld.find(trackOld) != recSimCollOld.end()) {
316  // tpOld = recSimCollOld[trackOld];
317  // if (tpOld.size()!=0) {
318  // LogTrace("TestOutliers") <<"old was associated with fraction=" << tpOld.begin()->second;
319  // if (tpOld.begin()->second>0.5) hitsPerTrackLost->Fill(trackOld->numberOfValidHits());
320  // }
321  // }
322  // LogTrace("TestOutliers") <<"...skip to next old track";
323  // continue;
324  // }
325  // //++i;
326  countOutT->Fill(1);
327 
328  //if ( !selectRecoTracks( *trackOld,beamSpot.product() ) ) continue;//no more cuts
329 
330  tracks->Fill(0);//FIXME
331 
333  TrackingParticleRef tprOut;
334  TrackingParticleRef tprOld;
335  double fracOut;
336  std::vector<unsigned int> tpids;
337  std::vector<std::pair<TrackingParticleRef, double> > tpOut;
338  std::vector<pair<TrackingParticleRef, double> > tpOld;
339  //contare outliers delle tracce che erano associate e non lo sono piu!!!!
340 
341  if(outAssoc) {//save the ids od the tp associate to the out track
342  tpOut = recSimCollOut[trackOut];
343  if (tpOut.size()!=0) {
344  countOutA->Fill(1);
345  tprOut = tpOut.begin()->first;
346  fracOut = tpOut.begin()->second;
347  for (TrackingParticle::g4t_iterator g4T=tprOut->g4Track_begin(); g4T!=tprOut->g4Track_end(); ++g4T) {
348  tpids.push_back(g4T->trackId());
349  }
350  }
351  }
352 
353  if(oldAssoc){//save the ids od the tp associate to the old track
354  tpOld = recSimCollOld[trackOld];
355  if (tpOld.size()!=0) {
356  tprOld = tpOld.begin()->first;
357  // LogTrace("TestOutliers") <<"old associated and out not! old has #hits=" << trackOld->numberOfValidHits()
358  // << " and fraction=" << tpOld.begin()->second;
359  // if (tpOld.begin()->second>0.5) hitsPerTrackLost->Fill(trackOld->numberOfValidHits());//deve essere un plot diverso tipo LostAssoc
360  if (tpOut.size()==0) {
361  for (TrackingParticle::g4t_iterator g4T=tprOld->g4Track_begin(); g4T!=tprOld->g4Track_end(); ++g4T) {
362  tpids.push_back(g4T->trackId());
363  }
364  }
365  }
366  }
367 
368  if (tprOut.get()!=0 || tprOld.get()!=0) { //at least one of the tracks has to be associated
369 
370  tpr = tprOut.get()!=0 ? tprOut : tprOld;
371 
372  const SimTrack * assocTrack = &(*tpr->g4Track_begin());
373 
374  //if ( trackOut->numberOfValidHits() < trackOld->numberOfValidHits() ) {
375  if ( trackOut->numberOfValidHits() != trackOld->numberOfValidHits() ||
376  !trackOut->recHitsBegin()->get()->sharesInput(trackOld->recHitsBegin()->get(),TrackingRecHit::some) ||
377  !(trackOut->recHitsEnd()-1)->get()->sharesInput((trackOld->recHitsEnd()-1)->get(),TrackingRecHit::some) )
378  { //there are outliers if the number of valid hits is != or if the first and last hit does not match
379  LogTrace("TestOutliers") << "outliers for track with #hits=" << trackOut->numberOfValidHits();
380  tracks->Fill(1);
381  LogTrace("TestOutliers") << "Out->pt=" << trackOut->pt() << " Old->pt=" << trackOld->pt()
382  << " tp->pt=" << sqrt(tpr->momentum().perp2())
383  //<< " trackOut->ptError()=" << trackOut->ptError() << " trackOld->ptError()=" << trackOld->ptError()
384  << " Old->validHits=" << trackOld->numberOfValidHits() << " Out->validHits=" << trackOut->numberOfValidHits()
385  /*<< " fracOld=" << fracOld*/ << " fracOut=" << fracOut
386  << " deltaHits=" << trackOld->numberOfValidHits()-trackOut->numberOfValidHits();
387 
388  //compute all the track parameters
389  double PtPullOut = (trackOut->pt()-sqrt(tpr->momentum().perp2()))/trackOut->ptError();
390  double PtPullOld = (trackOld->pt()-sqrt(tpr->momentum().perp2()))/trackOld->ptError();
391  histoPtOut->Fill( PtPullOut );
392  histoPtOld->Fill( PtPullOld );
393 
394  //LogTrace("TestOutliers") << "MagneticField";
396  iSetup.get<IdealMagneticFieldRecord>().get(theMF);
398  ftsAtProduction(GlobalPoint(tpr->vertex().x(),tpr->vertex().y(),tpr->vertex().z()),
399  GlobalVector(assocTrack->momentum().x(),assocTrack->momentum().y(),assocTrack->momentum().z()),
400  TrackCharge(trackOld->charge()),
401  theMF.product());
402  TSCPBuilderNoMaterial tscpBuilder;
403  TrajectoryStateClosestToPoint tsAtClosestApproach
404  = tscpBuilder(ftsAtProduction,GlobalPoint(0,0,0));//as in TrackProducerAlgorithm
405  GlobalPoint v = tsAtClosestApproach.theState().position();
406  GlobalVector p = tsAtClosestApproach.theState().momentum();
407 
408  //LogTrace("TestOutliers") << "qoverpSim";
409  double qoverpSim = tsAtClosestApproach.charge()/p.mag();
410  double lambdaSim = M_PI/2-p.theta();
411  double phiSim = p.phi();
412  double dxySim = (-v.x()*sin(p.phi())+v.y()*cos(p.phi()));
413  double dszSim = v.z()*p.perp()/p.mag() - (v.x()*p.x()+v.y()*p.y())/p.perp() * p.z()/p.mag();
414  double d0Sim = -dxySim;
415  double dzSim = dszSim*p.mag()/p.perp();
416 
417  //LogTrace("TestOutliers") << "qoverpPullOut";
418  double qoverpPullOut=(trackOut->qoverp()-qoverpSim)/trackOut->qoverpError();
419  double qoverpPullOld=(trackOld->qoverp()-qoverpSim)/trackOld->qoverpError();
420  double lambdaPullOut=(trackOut->lambda()-lambdaSim)/trackOut->thetaError();
421  double lambdaPullOld=(trackOld->lambda()-lambdaSim)/trackOld->thetaError();
422  double phi0PullOut=(trackOut->phi()-phiSim)/trackOut->phiError();
423  double phi0PullOld=(trackOld->phi()-phiSim)/trackOld->phiError();
424  double d0PullOut=(trackOut->d0()-d0Sim)/trackOut->d0Error();
425  double d0PullOld=(trackOld->d0()-d0Sim)/trackOld->d0Error();
426  double dzPullOut=(trackOut->dz()-dzSim)/trackOut->dzError();
427  double dzPullOld=(trackOld->dz()-dzSim)/trackOld->dzError();
428 
429  //LogTrace("TestOutliers") << "histoQoverpOut";
430  histoQoverpOut->Fill(qoverpPullOut);
431  histoQoverpOld->Fill(qoverpPullOld);
432  histoPhiOut->Fill(phi0PullOut);
433  histoPhiOld->Fill(phi0PullOld);
434  histoD0Out->Fill(d0PullOut);
435  histoD0Old->Fill(d0PullOld);
436  histoDzOut->Fill(dzPullOut);
437  histoDzOld->Fill(dzPullOld);
438  histoLambdaOut->Fill(lambdaPullOut);
439  histoLambdaOld->Fill(lambdaPullOld);
440 
441  //delta number of valid hits
442  LogTrace("TestOutliers") << "deltahits=" << trackOld->numberOfValidHits()-trackOut->numberOfValidHits();
443  deltahits->Fill(trackOld->numberOfValidHits()-trackOut->numberOfValidHits());
444 
445  if(tprOut.get()!=0 && tprOld.get()==0) { //out associated and old not: gained track
446  if (tpOld.size()!=0 && tpOld.begin()->second<=0.5) {
447  deltahitsAssocGained->Fill(trackOld->numberOfValidHits()-trackOut->numberOfValidHits());
448  hitsPerTrackAssocGained->Fill(trackOut->numberOfValidHits());
449  LogTrace("TestOutliers") << "a) gained (assoc) track out #hits==" << trackOut->numberOfValidHits() << " old #hits=" << trackOld->numberOfValidHits();
450  } else {
451  deltahitsAssocGained->Fill(trackOld->numberOfValidHits()-trackOut->numberOfValidHits());
452  hitsPerTrackAssocGained->Fill(trackOut->numberOfValidHits());
453  LogTrace("TestOutliers") << "b) gained (assoc) track out #hits==" << trackOut->numberOfValidHits() << " old #hits=" << trackOld->numberOfValidHits();
454  }
455  } else if(tprOut.get()==0 && tprOld.get()!=0) { //old associated and out not: lost track
456  LogTrace("TestOutliers") <<"old associated and out not! old has #hits=" << trackOld->numberOfValidHits()
457  << " and fraction=" << tpOld.begin()->second;
458  if (tpOld.begin()->second>0.5) {
459  hitsPerTrackAssocLost->Fill(trackOld->numberOfValidHits());
460  deltahitsAssocLost->Fill(trackOld->numberOfValidHits()-trackOut->numberOfValidHits());
461  }
462  }
463 
464  if ( fabs(PtPullOut) < fabs(PtPullOld) )
465  deltahitsOK->Fill(trackOld->numberOfValidHits()-trackOut->numberOfValidHits());
466  else
467  deltahitsNO->Fill(trackOld->numberOfValidHits()-trackOut->numberOfValidHits());
468 
469  //LogTrace("TestOutliers") << "RecoTrackSelector";
470  //if (selectRecoTracks(*trackOut,beamSpot.product())) okcutsOut->Fill(1); else okcutsOut->Fill(0);
471  //if (selectRecoTracks(*trackOld,beamSpot.product())) okcutsOld->Fill(1); else okcutsOld->Fill(0);
472 
473  LogTrace("TestOutliers") << "track old";
474  for (trackingRecHit_iterator itOld = trackOld->recHitsBegin(); itOld!=trackOld->recHitsEnd() ; itOld++){
475  LogTrace("TestOutliers") << (*itOld)->isValid() << " " << (*itOld)->geographicalId().rawId();
476  }
477  LogTrace("TestOutliers") << "track out";
478  for (trackingRecHit_iterator itOut = trackOut->recHitsBegin(); itOut!=trackOut->recHitsEnd() ; itOut++){
479  LogTrace("TestOutliers") << (*itOut)->isValid() << " " << (*itOut)->geographicalId().rawId();
480  }
481  //LogTrace("TestOutliers") << "itOut";
482 
483 
484  vector<pair<int, trackingRecHit_iterator> > gainedlostoutliers;
485  //look for gained hits
486  for (trackingRecHit_iterator itOut = trackOut->recHitsBegin(); itOut!=trackOut->recHitsEnd(); itOut++){
487  bool gained = true;
488  if ((*itOut)->isValid()) {
489  for (trackingRecHit_iterator itOld = trackOld->recHitsBegin(); itOld!=trackOld->recHitsEnd() ; itOld++){
490  if ( (*itOld)->geographicalId().rawId()==(*itOut)->geographicalId().rawId() ) gained = false;
491  }
492  if (gained) {
493  gainedlostoutliers.push_back(pair<int, trackingRecHit_iterator>(1,itOut));
494  LogTrace("TestOutliers") << "broken trajectory during old fit... gained hit " << (*itOut)->geographicalId().rawId();
495  gainedhits->Fill(1);
496  }
497  }
498  }
499 
500  //look for outliers and lost hits
501  for (trackingRecHit_iterator itOld = trackOld->recHitsBegin(); itOld!=trackOld->recHitsEnd() ; itOld++){
502 
503  bool outlier = false;
504  bool lost = true;
505 
506  for (trackingRecHit_iterator itOut = trackOut->recHitsBegin(); itOut!=trackOut->recHitsEnd(); itOut++){
507  if ( (*itOld)->geographicalId().rawId()==(*itOut)->geographicalId().rawId() ) {
508  lost=false;
509  if ( (*itOld)->isValid() && !(*itOut)->isValid() && (*itOld)->geographicalId().rawId()==(*itOut)->geographicalId().rawId() ) {
510  LogTrace("TestOutliers") << (*itOld)->isValid() << " " << (*itOut)->isValid() << " "
511  << (*itOld)->geographicalId().rawId() << " " << (*itOut)->geographicalId().rawId();
512  outlier=true;
513  }
514  }
515  }
516  if (lost) gainedlostoutliers.push_back(pair<int, trackingRecHit_iterator>(2,itOld));
517  if (lost) LogTrace("TestOutliers") << "lost";
518  else if (outlier) gainedlostoutliers.push_back(pair<int, trackingRecHit_iterator>(3,itOld));
519  }
520 
521  for (std::vector<pair<int, trackingRecHit_iterator> >::iterator it = gainedlostoutliers.begin(); it!=gainedlostoutliers.end();++it) {
522  LogTrace("TestOutliers") << "type of processed hit:" <<it->first;
523  trackingRecHit_iterator itHit = it->second;
524  bool gained = false;
525  bool lost = false;
526  bool outlier = false;
527  if (it->first==1) gained = true;
528  else if (it->first==2) lost = true;
529  else if (it->first==3) outlier = true;
530 
531  if (outlier||lost||gained) {
532  //if (1) {
533 
534  if (lost && (*itHit)->isValid()==false) {
535  goodbadmergedLost->Fill(0);
536  LogTrace("TestOutliers") << "lost invalid";
537  continue;
538  }
539  else if (gained && (*itHit)->isValid()==false) {
540  goodbadmergedGained->Fill(0);
541  LogTrace("TestOutliers") << "gained invalid";
542  continue;
543  }
544 
545  //LogTrace("TestOutliers") << "vector<SimHitIdpr>";
546  //look if the hit comes from a correct sim track
547  std::vector<SimHitIdpr> simTrackIds = hitAssociator->associateHitId(**itHit);
548  bool goodhit = false;
549  for(size_t j=0; j<simTrackIds.size(); j++){
550  for (size_t jj=0; jj<tpids.size(); jj++){
551  if (simTrackIds[j].first == tpids[jj]) goodhit = true;
552  break;
553  }
554  }
555 
556  //find what kind of hit is it
557  int clustersize = 0;
558  int hittypeval = 0;
559  int layerval = 0 ;
560  if (dynamic_cast<const SiPixelRecHit*>(&**itHit)){
561  LogTrace("TestOutliers") << "SiPixelRecHit";
562  clustersize = ((const SiPixelRecHit*)(&**itHit))->cluster()->size() ;
563  hittypeval = 1;
564  }
565  else if (dynamic_cast<const SiStripRecHit2D*>(&**itHit)){
566  LogTrace("TestOutliers") << "SiStripRecHit2D";
567  clustersize = ((const SiStripRecHit2D*)(&**itHit))->cluster()->amplitudes().size() ;
568  hittypeval = 2;
569  }
570  else if (dynamic_cast<const SiStripMatchedRecHit2D*>(&**itHit)){
571  LogTrace("TestOutliers") << "SiStripMatchedRecHit2D";
572  int clsize1 = ((const SiStripMatchedRecHit2D*)(&**itHit))->monoCluster().amplitudes().size();
573  int clsize2 = ((const SiStripMatchedRecHit2D*)(&**itHit))->stereoCluster().amplitudes().size();
574  if (clsize1>clsize2) clustersize = clsize1;
575  else clustersize = clsize2;
576  hittypeval = 3;
577  }
578  else if (dynamic_cast<const ProjectedSiStripRecHit2D*>(&**itHit)){
579  LogTrace("TestOutliers") << "ProjectedSiStripRecHit2D";
580  clustersize = ((const ProjectedSiStripRecHit2D*)(&**itHit))->originalHit().cluster()->amplitudes().size();
581  hittypeval = 4;
582  }
583 
584  //find the layer of the hit
585  int subdetId = (*itHit)->geographicalId().subdetId();
586  int layerId = 0;
587  DetId id = (*itHit)->geographicalId();
588  if (id.subdetId()==3) layerId = ((TIBDetId)(id)).layer();
589  if (id.subdetId()==5) layerId = ((TOBDetId)(id)).layer();
590  if (id.subdetId()==1) layerId = ((PXBDetId)(id)).layer();
591  if (id.subdetId()==4) layerId = ((TIDDetId)(id)).wheel();
592  if (id.subdetId()==6) layerId = ((TECDetId)(id)).wheel();
593  if (id.subdetId()==2) layerId = ((PXFDetId)(id)).disk();
594  layerval = subdetId*10+layerId;
595 
596  //LogTrace("TestOutliers") << "gpos";
597  GlobalPoint gpos = theG->idToDet((*itHit)->geographicalId())->surface().toGlobal((*itHit)->localPosition());
598 
599 
600  //get the vector of sim hit associated and choose the one with the largest energy loss
601  //double delta = 99999;
602  //LocalPoint rhitLPv = (*itHit)->localPosition();
603  //vector<PSimHit> assSimHits = hitAssociator->associateHit(**itHit);
604  //if (assSimHits.size()==0) continue;
605  //PSimHit shit;
606  //for(std::vector<PSimHit>::const_iterator m=assSimHits.begin(); m<assSimHits.end(); m++){
607  //if ((m->localPosition()-rhitLPv).mag()<delta) {
608  // shit=*m;
609  // delta = (m->localPosition()-rhitLPv).mag();
610  // }
611  //}
612  //LogTrace("TestOutliers") << "energyLoss_";
613  double energyLoss_ = 0.;
614  unsigned int monoId = 0;
615  std::vector<double> energyLossM;
616  std::vector<double> energyLossS;
617  std::vector<PSimHit> assSimHits = hitAssociator->associateHit(**itHit);
618  if (assSimHits.size()==0) continue;
619  PSimHit shit;
620  std::vector<unsigned int> trackIds;
621  energyLossS.clear();
622  energyLossM.clear();
623  //LogTrace("TestOutliers") << "energyLossM";
624  for(std::vector<PSimHit>::const_iterator m=assSimHits.begin(); m<assSimHits.end(); m++){
625  if (outlier) energyLoss->Fill(m->energyLoss());
626  unsigned int tId = m->trackId();
627  if (find(trackIds.begin(),trackIds.end(),tId)==trackIds.end()) trackIds.push_back(tId);
628  LogTrace("TestOutliers") << "id=" << tId;
629  if (m->energyLoss()>energyLoss_) {
630  shit=*m;
631  energyLoss_ = m->energyLoss();
632  }
633  if (hittypeval==3) {
634  if (monoId==0) monoId = m->detUnitId();
635  if (monoId == m->detUnitId()){
636  energyLossM.push_back(m->energyLoss());
637  }
638  else {
639  energyLossS.push_back(m->energyLoss());
640  }
641  //std::cout << "detUnitId=" << m->detUnitId() << " trackId=" << m->trackId() << " energyLoss=" << m->energyLoss() << std::endl;
642  } else {
643  energyLossM.push_back(m->energyLoss());
644  }
645  }
646  unsigned int nIds = trackIds.size();
647 
648  if (outlier) {
649  goodbadhits->Fill(goodhit);
650  posxy->Fill(fabs(gpos.x()),fabs(gpos.y()));
651  poszr->Fill(fabs(gpos.z()),sqrt(gpos.x()*gpos.x()+gpos.y()*gpos.y()));
652  process->Fill(shit.processType());
653  energyLossMax->Fill(energyLoss_);
654  }
655 
656  //look if the hit is shared and if is produced only by ionization processes
657  bool shared = true;
658  bool ioniOnly = true;
659  unsigned int idc = 0;
660  for (size_t jj=0; jj<tpids.size(); jj++){
661  idc += std::count(trackIds.begin(),trackIds.end(),tpids[jj]);
662  }
663  if (idc==trackIds.size()) {
664  shared = false;
665  }
666  for(std::vector<PSimHit>::const_iterator m=assSimHits.begin()+1; m<assSimHits.end(); m++){
667  if ((m->processType()!=7&&m->processType()!=8&&m->processType()!=9)&&abs(m->particleType())!=11){
668  ioniOnly = false;
669  break;
670  }
671  }
672  if (ioniOnly&&!shared){
673  LogTrace("TestOutliers") << "delta";
674  }
675 
676  if (goodhit) {
677  if (outlier) {
678  goodprocess->Fill(shit.processType());
679  if (clustersize>=4) {
680  goodhittype_clgteq4->Fill(hittypeval);
681  goodlayer_clgteq4->Fill(layerval);
682  } else {
683  goodhittype_cllt4->Fill(hittypeval);
684  goodlayer_cllt4->Fill(layerval);
685  }
686  //LogTrace("TestOutliers") << "hittypeval && clustersize";
687  if (hittypeval==1 && clustersize>=4) goodpixgteq4_simvecsize->Fill(assSimHits.size());
688  if (hittypeval==1 && clustersize<4 ) goodpixlt4_simvecsize->Fill(assSimHits.size());
689  if (hittypeval==2 && clustersize>=4) goodst1gteq4_simvecsize->Fill(assSimHits.size());
690  if (hittypeval==2 && clustersize<4 ) goodst1lt4_simvecsize->Fill(assSimHits.size());
691  if (hittypeval==3 && clustersize>=4) goodst2gteq4_simvecsize->Fill(assSimHits.size());
692  if (hittypeval==3 && clustersize<4 ) goodst2lt4_simvecsize->Fill(assSimHits.size());
693  if (hittypeval==4 && clustersize>=4) goodprjgteq4_simvecsize->Fill(assSimHits.size());
694  if (hittypeval==4 && clustersize<4 ) goodprjlt4_simvecsize->Fill(assSimHits.size());
695 
696  //LogTrace("TestOutliers") << "hittypeval";
697  if (hittypeval==1) goodpix_clustersize->Fill(clustersize);
698  if (hittypeval==2) goodst1_clustersize->Fill(clustersize);
699  if (hittypeval==3) goodst2_clustersize->Fill(clustersize);
700  if (hittypeval==4) goodprj_clustersize->Fill(clustersize);
701  if (hittypeval==1) goodpix_simvecsize->Fill(assSimHits.size());
702  if (hittypeval==2) goodst1_simvecsize->Fill(assSimHits.size());
703  if (hittypeval==3) goodst2_simvecsize->Fill(assSimHits.size());
704  if (hittypeval==4) goodprj_simvecsize->Fill(assSimHits.size());
705 
706  //LogTrace("TestOutliers") << "nOfTrackIds";
707  nOfTrackIds->Fill(nIds);
708  if (hittypeval!=3) {
709  if (energyLossM.size()>1) {
710  sort(energyLossM.begin(),energyLossM.end(),greater<double>());
711  energyLossRatio->Fill(energyLossM[1]/energyLossM[0]);
712  }
713  } else {
714  //LogTrace("TestOutliers") << "hittypeval==3";
715  if (energyLossM.size()>1&&energyLossS.size()<=1) {
716  sort(energyLossM.begin(),energyLossM.end(),greater<double>());
717  energyLossRatio->Fill(energyLossM[1]/energyLossM[0]);
718  }
719  else if (energyLossS.size()>1&&energyLossM.size()<=1) {
720  sort(energyLossS.begin(),energyLossS.end(),greater<double>());
721  energyLossRatio->Fill(energyLossS[1]/energyLossS[0]);
722  }
723  else if (energyLossS.size()>1&&energyLossM.size()>1) {
724  sort(energyLossM.begin(),energyLossM.end(),greater<double>());
725  sort(energyLossS.begin(),energyLossS.end(),greater<double>());
726  energyLossM[1]/energyLossM[0] > energyLossS[1]/energyLossS[0]
727  ? energyLossRatio->Fill(energyLossM[1]/energyLossM[0])
728  : energyLossRatio->Fill(energyLossS[1]/energyLossS[0]);
729  }
730  }
731 
732  LogTrace("TestOutliers") << "before merged";
733  const SiStripMatchedRecHit2D* tmp = dynamic_cast<const SiStripMatchedRecHit2D*>(&**itHit);
734  LogTrace("TestOutliers") << "tmp=" << tmp;
735  LogTrace("TestOutliers") << "assSimHits.size()=" << assSimHits.size();
736  if ( (assSimHits.size()>1 && tmp==0) ||
737  (assSimHits.size()>2 && tmp!=0) ) {
738  //std::cout << "MERGED HIT" << std::endl;
739  //LogTrace("TestOutliers") << "merged";
740  mergedlayer->Fill(layerval);
741  mergedcluster->Fill(clustersize);
742  mergedhittype->Fill(hittypeval);
743 
744  for(std::vector<PSimHit>::const_iterator m=assSimHits.begin(); m<assSimHits.end(); m++){
745  unsigned int tId = m->trackId();
746  LogTrace("TestOutliers") << "component with id=" << tId << " eLoss=" << m->energyLoss()
747  << " proc=" << m->processType() << " part=" << m->particleType();
748  if (find(tpids.begin(),tpids.end(),tId)==tpids.end()) continue;
749  if (m->processType()==2) {
750  //GlobalPoint gpos = theG->idToDet((*itHit)->geographicalId())->surface().toGlobal((*itHit)->localPosition());
751  //GlobalPoint gpr = rhit->globalPosition();
752  AlgebraicSymMatrix33 ger =
753  ErrorFrameTransformer().transform((*itHit)->localPositionError(),theG->idToDet((*itHit)->geographicalId())->surface() ).matrix();
754  //AlgebraicSymMatrix ger = rhit->globalPositionError().matrix();
755  GlobalPoint gps = theG->idToDet((*itHit)->geographicalId())->surface().toGlobal(m->localPosition());
756  //LogTrace("TestOutliers") << gpr << " " << gps << " " << ger;
757  ROOT::Math::SVector<double,3> delta;
758  delta[0]=gpos.x()-gps.x();
759  delta[1]=gpos.y()-gps.y();
760  delta[2]=gpos.z()-gps.z();
761  LogTrace("TestOutliers") << delta << " " << ger ;
762  double mpull = sqrt(delta[0]*delta[0]/ger[0][0]+delta[1]*delta[1]/ger[1][1]+delta[2]*delta[2]/ger[2][2]);
763  LogTrace("TestOutliers") << "hit pull=" << mpull;//ger.similarity(delta);
764  mergedPull->Fill(mpull);
765  }
766  }
767  LogTrace("TestOutliers") << "end merged";
768  } else {//not merged=>good
769  //LogTrace("TestOutliers") << "goodlayer";
770  goodlayer->Fill(layerval);
771  goodcluster->Fill(clustersize);
772  goodhittype->Fill(hittypeval);
773  }
774  }//if (outlier)
775 
776  const SiPixelRecHit* pix = dynamic_cast<const SiPixelRecHit*>(&**itHit);
777  if ((hittypeval!=3 && assSimHits.size()<2)||(hittypeval==3 && assSimHits.size()<3)){
778  if (outlier) {
779  goodhittype_simvecsmall->Fill(hittypeval);
780  goodlayer_simvecsmall->Fill(layerval);
781  goodbadmerged->Fill(1);
782  if (pix) {
783  probXgood->Fill(pix->probabilityX());
784  probYgood->Fill(pix->probabilityY());
785  }
786  LogTrace("TestOutliers") << "out good";
787  }
788  else if (lost){
789  goodbadmergedLost->Fill(1);
790  LogTrace("TestOutliers") << "lost good";
791  }
792  else if (gained){
793  goodbadmergedGained->Fill(1);
794  LogTrace("TestOutliers") << "gained good";
795  }
796  LogTrace("TestOutliers") << "good";
797  } else {
798  if (outlier) {
799  goodhittype_simvecbig->Fill(hittypeval);
800  goodlayer_simvecbig->Fill(layerval);
801  if (ioniOnly&&!shared) {
802  goodbadmerged->Fill(3);
803  if (pix) {
804  probXdelta->Fill(pix->probabilityX());
805  probYdelta->Fill(pix->probabilityY());
806  }
807  } else if(!ioniOnly&&!shared) {
808  goodbadmerged->Fill(4);
809  if (pix) {
810  probXnoshare->Fill(pix->probabilityX());
811  probYnoshare->Fill(pix->probabilityY());
812  }
813  } else {
814  goodbadmerged->Fill(5);
815  if (pix) {
816  probXshared->Fill(pix->probabilityX());
817  probYshared->Fill(pix->probabilityY());
818  }
819  }
820  LogTrace("TestOutliers") << "out merged, ioniOnly=" << ioniOnly << " shared=" << shared;
821  }
822  else if (lost) {
823  if (ioniOnly&&!shared) goodbadmergedLost->Fill(3);
824  else if(!ioniOnly&&!shared) goodbadmergedLost->Fill(4);
825  else goodbadmergedLost->Fill(5);
826  LogTrace("TestOutliers") << "lost merged, ioniOnly=" << ioniOnly << " shared=" << shared;
827  }
828  else if (gained) {
829  if (ioniOnly&&!shared) goodbadmergedGained->Fill(3);
830  else if(!ioniOnly&&!shared) goodbadmergedGained->Fill(4);
831  else goodbadmergedGained->Fill(5);
832  LogTrace("TestOutliers") << "gained merged, ioniOnly=" << ioniOnly << " shared=" << shared;
833  }
834  LogTrace("TestOutliers") << "merged, ioniOnly=" << ioniOnly << " shared=" << shared;
835  }
836  } //if (goodhit)
837  else {//badhit
838  //LogTrace("TestOutliers") << "badhit";
839  if (outlier) {
840  badcluster->Fill(clustersize);
841  badhittype->Fill(hittypeval);
842  badlayer->Fill(layerval);
843  badprocess->Fill(shit.processType());
844  goodbadmerged->Fill(2);
845  const SiPixelRecHit* pix = dynamic_cast<const SiPixelRecHit*>(&**itHit);
846  if (pix) {
847  probXbad->Fill(pix->probabilityX());
848  probYbad->Fill(pix->probabilityY());
849  }
850  LogTrace("TestOutliers") << "out bad";
851  }
852  else if (lost) {
853  goodbadmergedLost->Fill(2);
854  LogTrace("TestOutliers") << "lost bad";
855  }
856  else if (gained) {
857  goodbadmergedGained->Fill(2);
858  LogTrace("TestOutliers") << "gained bad";
859  }
860  LogTrace("TestOutliers") << "bad";
861  }
862  }
863  }
864  }
865  //else if ( trackOut->numberOfValidHits() > trackOld->numberOfValidHits() ) {
866  else if ( 0 ) {
867  LogTrace("TestOutliers") << "outliers for track with #hits=" << trackOut->numberOfValidHits();
868  tracks->Fill(1);
869  LogTrace("TestOutliers") << "Out->pt=" << trackOut->pt() << " Old->pt=" << trackOld->pt()
870  << " tp->pt=" << sqrt(tpr->momentum().perp2())
871  //<< " trackOut->ptError()=" << trackOut->ptError() << " trackOld->ptError()=" << trackOld->ptError()
872  << " Old->validHits=" << trackOld->numberOfValidHits() << " Out->validHits=" << trackOut->numberOfValidHits()
873  /*<< " fracOld=" << fracOld*/ << " fracOut=" << fracOut
874  << " deltaHits=" << trackOld->numberOfValidHits()-trackOut->numberOfValidHits();
875  LogTrace("TestOutliers") << "track with gained hits";
876  gainedhits2->Fill(trackOut->numberOfValidHits()-trackOld->numberOfValidHits());
877  } else {
878  LogTrace("TestOutliers") << "no outliers for track with #hits=" << trackOut->numberOfValidHits();
879  }
880  }
881  LogTrace("TestOutliers") << "end track old #" << j;
882  }
883 
884  for (unsigned int k=0;k<tracksOut->size();++k) {
885  if ( find(outused.begin(),outused.end(),k)==outused.end() ) {
886  edm::RefToBase<reco::Track> trackOut(tracksOut, k);
887  bool outAssoc = recSimCollOut.find(trackOut) != recSimCollOut.end();
888  if (outAssoc) {
889  hitsPerTrackGained->Fill(trackOut->numberOfValidHits());
890  LogTrace("TestOutliers") << "gained track out id=" << k << " #hits==" << trackOut->numberOfValidHits();
891 
892  }
893  }
894  }
895  delete hitAssociator;
896  delete theAssociatorOld;
897  delete theAssociatorOut;
898 }
TH1F * histoLambdaOut
Definition: TestOutliers.cc:89
double qoverp() const
q/p
Definition: TrackBase.h:115
dbl * delta
Definition: mlp_gen.cc:36
TH1F * hitsPerTrackGained
Definition: TestOutliers.cc:90
static GlobalError transform(const LocalError &le, const Surface &surf)
double d0Error() const
error on d0
Definition: TrackBase.h:211
TH1F * goodhittype_cllt4
Definition: TestOutliers.cc:93
TH1F * mergedcluster
T perp() const
Definition: PV3DBase.h:71
TH1F * histoDzOld
Definition: TestOutliers.cc:88
TH1F * goodprj_clustersize
TH1F * probXshared
double d0() const
dxy parameter in perigee convention (d0 = - dxy)
Definition: TrackBase.h:123
TH1F * goodpixlt4_simvecsize
Definition: TestOutliers.cc:95
TH1F * goodhittype
Definition: TestOutliers.cc:93
TH1F * histoQoverpOut
Definition: TestOutliers.cc:85
TH1F * hitsPerTrackAssocLost
Definition: TestOutliers.cc:90
const FreeTrajectoryState & theState() const
TH1F * goodst1_simvecsize
TH1F * goodst2lt4_simvecsize
Definition: TestOutliers.cc:97
TH1F * goodbadmergedLost
TH1F * goodst1gteq4_simvecsize
Definition: TestOutliers.cc:96
TH1F * goodprj_simvecsize
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
Global3DPoint GlobalPoint
Definition: GlobalPoint.h:10
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:10
T y() const
Definition: PV3DBase.h:62
#define abs(x)
Definition: mlp_lapack.h:159
TH1F * deltahitsNO
Definition: TestOutliers.cc:90
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:139
edm::ParameterSet psetold
TH1F * energyLossRatio
TH1F * histoPtOut
Definition: TestOutliers.cc:84
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
uint16_t size_type
std::vector< SimHitIdpr > associateHitId(const TrackingRecHit &thit)
TH1F * hitsPerTrackAssocGained
Definition: TestOutliers.cc:90
TH1F * process
Definition: TestOutliers.cc:92
TH1F * goodst2_simvecsize
TH1F * probYdelta
TH1F * energyLossMax
TH1F * probYgood
TH1F * badhittype
Definition: TestOutliers.cc:93
Geom::Theta< T > theta() const
Definition: PV3DBase.h:74
TH1F * goodlayer_clgteq4
Definition: TestOutliers.cc:93
TH1F * mergedhittype
int TrackCharge
Definition: TrackCharge.h:4
TH1F * energyLoss
TH1F * deltahits
Definition: TestOutliers.cc:90
TH1F * histoD0Old
Definition: TestOutliers.cc:87
TH1F * probYshared
TH1F * goodprocess
Definition: TestOutliers.cc:92
TH1F * goodhittype_simvecsmall
TH1F * goodpix_clustersize
Definition: TestOutliers.cc:99
TH1F * goodprjgteq4_simvecsize
Definition: TestOutliers.cc:98
T mag() const
Definition: PV3DBase.h:66
TH1F * badlayer
Definition: TestOutliers.cc:93
TH1F * goodst1_clustersize
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
TH1F * goodpixgteq4_simvecsize
Definition: TestOutliers.cc:95
TH1F * histoPhiOld
Definition: TestOutliers.cc:86
TH1F * badcluster
Definition: TestOutliers.cc:92
TH1F * probXgood
TH1F * countOutA
TH1F * goodprjlt4_simvecsize
Definition: TestOutliers.cc:98
T sqrt(T t)
Definition: SSEVec.h:46
double pt() const
track transverse momentum
Definition: TrackBase.h:131
T z() const
Definition: PV3DBase.h:63
TH1F * goodpix_simvecsize
TH1F * goodlayer
Definition: TestOutliers.cc:93
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
TH1F * badprocess
Definition: TestOutliers.cc:92
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:194
TH1F * histoPhiOut
Definition: TestOutliers.cc:86
double phiError() const
error on phi
Definition: TrackBase.h:207
int j
Definition: DBlmapReader.cc:9
double lambda() const
Lambda angle.
Definition: TrackBase.h:119
TH1F * goodlayer_simvecsmall
edm::ParameterSet psetout
TH1F * goodhittype_simvecbig
float probabilityY() const
Definition: SiPixelRecHit.h:81
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:232
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:63
bool first
Definition: L1TdeRCT.cc:94
edm::InputTag trackTagsOut_
Definition: TestOutliers.cc:74
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
TH1F * probXnoshare
GlobalVector momentum() const
#define LogTrace(id)
virtual reco::RecoToSimCollection associateRecoToSim(edm::Handle< edm::View< reco::Track > > &tCH, edm::Handle< TrackingParticleCollection > &tPCH, const edm::Event *event=0, const edm::EventSetup *setup=0) const
compare reco to sim the handle of reco::Track and TrackingParticle collections
TH1F * probYnoshare
int k[5][pyjets_maxn]
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:192
TH1F * mergedlayer
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
Definition: TrackBase.h:127
double dzError() const
error on dz
Definition: TrackBase.h:215
std::vector< SimTrack >::const_iterator g4t_iterator
TH1F * deltahitsOK
Definition: TestOutliers.cc:90
Definition: DetId.h:20
GlobalPoint position() const
TH1F * goodst1lt4_simvecsize
Definition: TestOutliers.cc:96
TH1F * histoPtOld
Definition: TestOutliers.cc:84
TH1F * goodhittype_clgteq4
Definition: TestOutliers.cc:93
edm::RefToBase< TrajectorySeed > seedRef() const
Definition: Track.h:112
#define M_PI
Definition: BFit3D.cc:3
edm::InputTag tpTags_
Definition: TestOutliers.cc:76
TH1F * deltahitsAssocGained
Definition: TestOutliers.cc:90
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
TrackAssociatorBase * theAssociatorOld
Definition: TestOutliers.cc:77
TH1F * goodlayer_cllt4
Definition: TestOutliers.cc:93
TH1F * histoDzOut
Definition: TestOutliers.cc:88
TrackAssociatorBase * theAssociatorOut
Definition: TestOutliers.cc:78
TH1F * probXdelta
TH1F * goodst2_clustersize
unsigned short processType() const
Definition: PSimHit.h:118
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
edm::EventID id() const
Definition: EventBase.h:56
TH1F * histoLambdaOld
Definition: TestOutliers.cc:89
TH1F * countOldT
TH1F * countOutT
const math::XYZTLorentzVectorD & momentum() const
particle info...
Definition: CoreSimTrack.h:36
TH1F * goodst2gteq4_simvecsize
Definition: TestOutliers.cc:97
TH1F * goodcluster
Definition: TestOutliers.cc:92
TH1F * histoD0Out
Definition: TestOutliers.cc:87
edm::ESHandle< TrackerGeometry > theG
Definition: TestOutliers.cc:81
std::vector< PSimHit > associateHit(const TrackingRecHit &thit)
TH1F * mergedPull
TH1F * goodbadmerged
TH1F * deltahitsAssocLost
Definition: TestOutliers.cc:90
TH1F * goodlayer_simvecbig
TH1F * histoQoverpOld
Definition: TestOutliers.cc:85
float probabilityX() const
Definition: SiPixelRecHit.h:78
TH1F * nOfTrackIds
edm::InputTag trackTagsOld_
Definition: TestOutliers.cc:75
TH1F * hitsPerTrackLost
Definition: TestOutliers.cc:90
TH1F * gainedhits
T const * get() const
Returns C++ pointer to the item.
Definition: Ref.h:242
TrackerHitAssociator * hitAssociator
Definition: TestOutliers.cc:80
T x() const
Definition: PV3DBase.h:61
value_type const * get() const
Definition: RefToBase.h:212
mathSSE::Vec4< T > v
TH1F * goodbadhits
Definition: TestOutliers.cc:92
Global3DVector GlobalVector
Definition: GlobalVector.h:10
double thetaError() const
error on theta
Definition: TrackBase.h:201
TH1F * goodbadmergedGained
Our base class.
Definition: SiPixelRecHit.h:22
TH1F * gainedhits2
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:65
void TestOutliers::beginRun ( edm::Run run,
const edm::EventSetup es 
)
privatevirtual

Definition at line 903 of file TestOutliers.cc.

References badcluster, badhittype, badlayer, badprocess, countOldT, countOutA, countOutT, deltahits, deltahitsAssocGained, deltahitsAssocLost, deltahitsNO, deltahitsOK, energyLoss, energyLossMax, energyLossRatio, file, gainedhits, gainedhits2, edm::EventSetup::get(), goodbadhits, goodbadmerged, goodbadmergedGained, goodbadmergedLost, goodcluster, goodhittype, goodhittype_clgteq4, goodhittype_cllt4, goodhittype_simvecbig, goodhittype_simvecsmall, goodlayer, goodlayer_clgteq4, goodlayer_cllt4, goodlayer_simvecbig, goodlayer_simvecsmall, goodpix_clustersize, goodpix_simvecsize, goodpixgteq4_simvecsize, goodpixlt4_simvecsize, goodprj_clustersize, goodprj_simvecsize, goodprjgteq4_simvecsize, goodprjlt4_simvecsize, goodprocess, goodst1_clustersize, goodst1_simvecsize, goodst1gteq4_simvecsize, goodst1lt4_simvecsize, goodst2_clustersize, goodst2_simvecsize, goodst2gteq4_simvecsize, goodst2lt4_simvecsize, histoD0Old, histoD0Out, histoDzOld, histoDzOut, histoLambdaOld, histoLambdaOut, histoPhiOld, histoPhiOut, histoPtOld, histoPtOut, histoQoverpOld, histoQoverpOut, hitsPerTrackAssocGained, hitsPerTrackAssocLost, hitsPerTrackGained, hitsPerTrackLost, mergedcluster, mergedhittype, mergedlayer, mergedPull, nOfTrackIds, okcutsOld, okcutsOut, out, posxy, poszr, probXbad, probXdelta, probXgood, probXnoshare, probXshared, probYbad, probYdelta, probYgood, probYnoshare, probYshared, process, sizeOld, sizeOldT, sizeOut, sizeOutT, theG, and tracks.

904 {
906  const bool oldAddDir = TH1::AddDirectoryStatus();
907  TH1::AddDirectory(true);
908  file = new TFile(out.c_str(),"recreate");
909  histoPtOut = new TH1F("histoPtOut","histoPtOut",100,-10,10);
910  histoPtOld = new TH1F("histoPtOld","histoPtOld",100,-10,10);
911  histoQoverpOut = new TH1F("histoQoverpOut","histoQoverpOut",250,-25,25);
912  histoQoverpOld = new TH1F("histoQoverpOld","histoQoverpOld",250,-25,25);
913  histoPhiOut = new TH1F("histoPhiOut","histoPhiOut",250,-25,25);
914  histoPhiOld = new TH1F("histoPhiOld","histoPhiOld",250,-25,25);
915  histoD0Out = new TH1F("histoD0Out","histoD0Out",250,-25,25);
916  histoD0Old = new TH1F("histoD0Old","histoD0Old",250,-25,25);
917  histoDzOut = new TH1F("histoDzOut","histoDzOut",250,-25,25);
918  histoDzOld = new TH1F("histoDzOld","histoDzOld",250,-25,25);
919  histoLambdaOut = new TH1F("histoLambdaOut","histoLambdaOut",250,-25,25);
920  histoLambdaOld = new TH1F("histoLambdaOld","histoLambdaOld",250,-25,25);
921  deltahits = new TH1F("deltahits","deltahits",80,-40,40);
922  deltahitsOK = new TH1F("deltahitsOK","deltahitsOK",20,0,20);
923  deltahitsNO = new TH1F("deltahitsNO","deltahitsNO",20,0,20);
924  okcutsOut = new TH1F("okcutsOut","okcutsOut",2,-0.5,1.5);
925  okcutsOld = new TH1F("okcutsOld","okcutsOld",2,-0.5,1.5);
926  tracks = new TH1F("tracks_","tracks_",2,-0.5,1.5);
927  goodbadhits = new TH1F("goodbadhits","goodbadhits",2,-0.5,1.5);
928  process = new TH1F("process","process",20,-0.5,19.5);
929  goodcluster = new TH1F("goodcluster","goodcluster",40,-0.5,39.5);
930  goodprocess = new TH1F("goodprocess","goodprocess",20,-0.5,19.5);
931  badcluster = new TH1F("badcluster","badcluster",40,-0.5,39.5);
932  badprocess = new TH1F("badprocess","badprocess",20,-0.5,19.5);
933  goodhittype = new TH1F("goodhittype","goodhittype",5,-0.5,4.5);
934  goodlayer = new TH1F("goodlayer","goodlayer",70,-0.5,69.5);
935  goodhittype_clgteq4 = new TH1F("goodhittype_clgteq4","goodhittype_clgteq4",5,-0.5,4.5);
936  goodlayer_clgteq4 = new TH1F("goodlayer_clgteq4","goodlayer_clgteq4",70,-0.5,69.5);
937  goodhittype_cllt4 = new TH1F("goodhittype_cllt4","goodhittype_cllt4",5,-0.5,4.5);
938  goodlayer_cllt4 = new TH1F("goodlayer_cllt4","goodlayer_cllt4",70,-0.5,69.5);
939  badhittype = new TH1F("badhittype","badhittype",5,-0.5,4.5);
940  badlayer = new TH1F("badlayer","badlayer",70,-0.5,69.5);
941  posxy = new TH2F("posxy","posxy",1200,0,120,1200,0,120);
942  poszr = new TH2F("poszr","poszr",3000,0,300,1200,0,120);
943  goodpixgteq4_simvecsize = new TH1F("goodpixgteq4_simvecsize","goodpixgteq4_simvecsize",40,-0.5,39.5);
944  goodpixlt4_simvecsize = new TH1F("goodpixlt4_simvecsize","goodpixlt4_simvecsize",40,-0.5,39.5);
945  goodst1gteq4_simvecsize = new TH1F("goodst1gteq4_simvecsize","goodst1gteq4_simvecsize",40,-0.5,39.5);
946  goodst1lt4_simvecsize = new TH1F("goodst1lt4_simvecsize","goodst1lt4_simvecsize",40,-0.5,39.5);
947  goodst2gteq4_simvecsize = new TH1F("goodst2gteq4_simvecsize","goodst2gteq4_simvecsize",40,-0.5,39.5);
948  goodst2lt4_simvecsize = new TH1F("goodst2lt4_simvecsize","goodst2lt4_simvecsize",40,-0.5,39.5);
949  goodprjgteq4_simvecsize = new TH1F("goodprjgteq4_simvecsize","goodprjgteq4_simvecsize",40,-0.5,39.5);
950  goodprjlt4_simvecsize = new TH1F("goodprjlt4_simvecsize","goodprjlt4_simvecsize",40,-0.5,39.5);
951  goodpix_clustersize = new TH1F("goodpix_clustersize","goodpix_clustersize",40,-0.5,39.5);
952  goodst1_clustersize = new TH1F("goodst1_clustersize","goodst1_clustersize",40,-0.5,39.5);
953  goodst2_clustersize = new TH1F("goodst2_clustersize","goodst2_clustersize",40,-0.5,39.5);
954  goodprj_clustersize = new TH1F("goodprj_clustersize","goodprj_clustersize",40,-0.5,39.5);
955  goodpix_simvecsize = new TH1F("goodpix_simvecsize","goodpix_simvecsize",40,-0.5,39.5);
956  goodst1_simvecsize = new TH1F("goodst1_simvecsize","goodst1_simvecsize",40,-0.5,39.5);
957  goodst2_simvecsize = new TH1F("goodst2_simvecsize","goodst2_simvecsize",40,-0.5,39.5);
958  goodprj_simvecsize = new TH1F("goodprj_simvecsize","goodprj_simvecsize",40,-0.5,39.5);
959  goodhittype_simvecsmall = new TH1F("goodhittype_simvecsmall","goodhittype_simvecsmall",5,-0.5,4.5);
960  goodlayer_simvecsmall = new TH1F("goodlayer_simvecsmall","goodlayer_simvecsmall",70,-0.5,69.5);
961  goodhittype_simvecbig = new TH1F("goodhittype_simvecbig","goodhittype_simvecbig",5,-0.5,4.5);
962  goodlayer_simvecbig = new TH1F("goodlayer_simvecbig","goodlayer_simvecbig",70,-0.5,69.5);
963  goodbadmerged = new TH1F("goodbadmerged","goodbadmerged",5,0.5,5.5);
964  goodbadmergedLost = new TH1F("goodbadmergedLost","goodbadmergedLost",5,0.5,5.5);
965  goodbadmergedGained = new TH1F("goodbadmergedGained","goodbadmergedGained",5,0.5,5.5);
966  energyLoss = new TH1F("energyLoss","energyLoss",1000,0,0.1);
967  energyLossMax = new TH1F("energyLossMax","energyLossMax",1000,0,0.1);
968  energyLossRatio = new TH1F("energyLossRatio","energyLossRatio",100,0,1);
969  nOfTrackIds = new TH1F("nOfTrackIds","nOfTrackIds",10,0,10);
970  mergedPull = new TH1F("mergedPull","mergedPull",100,0,10);
971  mergedlayer = new TH1F("mergedlayer","mergedlayer",70,-0.5,69.5);
972  mergedhittype = new TH1F("mergedhittype","mergedhittype",5,-0.5,4.5);
973  mergedcluster = new TH1F("mergedcluster","mergedcluster",40,-0.5,39.5);
974  deltahitsAssocGained = new TH1F("deltahitsAssocGained","deltahitsAssocGained",80, -40, 40);
975  deltahitsAssocLost = new TH1F("deltahitsAssocLost","deltahitsAssocLost",80, -40, 40);
976  hitsPerTrackLost = new TH1F("hitsPerTrackLost","hitsPerTrackLost",40, -0.5, 39.5);
977  hitsPerTrackAssocLost = new TH1F("hitsPerTrackAssocLost","hitsPerTrackAssocLost",40, -0.5, 39.5);
978  hitsPerTrackGained = new TH1F("hitsPerTrackGained","hitsPerTrackGained",40, -0.5, 39.5);
979  hitsPerTrackAssocGained = new TH1F("hitsPerTrackAssocGained","hitsPerTrackAssocGained",40, -0.5, 39.5);
980  sizeOut = new TH1F("sizeOut","sizeOut",900,-0.5,899.5);
981  sizeOld = new TH1F("sizeOld","sizeOld",900,-0.5,899.5);
982  sizeOutT = new TH1F("sizeOutT","sizeOutT",900,-0.5,899.5);
983  sizeOldT = new TH1F("sizeOldT","sizeOldT",900,-0.5,899.5);
984  countOutA = new TH1F("countOutA","countOutA",2,0,2);
985  countOutT = new TH1F("countOutT","countOutT",2,0,2);
986  countOldT = new TH1F("countOldT","countOldT",2,0,2);
987  gainedhits = new TH1F("gainedhits","gainedhits",2,0,2);
988  gainedhits2 = new TH1F("gainedhits2","gainedhits2",30,-0.5,29.5);
989  probXgood = new TH1F("probXgood","probXgood",110,0,1.1);
990  probXbad = new TH1F("probXbad","probXbad",110,0,1.1);
991  probXdelta = new TH1F("probXdelta","probXdelta",110,0,1.1);
992  probXshared = new TH1F("probXshared","probXshared",110,0,1.1);
993  probXnoshare = new TH1F("probXnoshare","probXnoshare",110,0,1.1);
994  probYgood = new TH1F("probYgood","probYgood",110,0,1.1);
995  probYbad = new TH1F("probYbad","probYbad",110,0,1.1);
996  probYdelta = new TH1F("probYdelta","probYdelta",110,0,1.1);
997  probYshared = new TH1F("probYshared","probYshared",110,0,1.1);
998  probYnoshare = new TH1F("probYnoshare","probYnoshare",110,0,1.1);
999  TH1::AddDirectory(oldAddDir);
1000 }
TH1F * histoLambdaOut
Definition: TestOutliers.cc:89
TH1F * hitsPerTrackGained
Definition: TestOutliers.cc:90
TH1F * goodhittype_cllt4
Definition: TestOutliers.cc:93
TH1F * mergedcluster
TH1F * histoDzOld
Definition: TestOutliers.cc:88
TH1F * goodprj_clustersize
TH1F * probXshared
TH1F * goodpixlt4_simvecsize
Definition: TestOutliers.cc:95
TH1F * goodhittype
Definition: TestOutliers.cc:93
TH1F * histoQoverpOut
Definition: TestOutliers.cc:85
TH1F * hitsPerTrackAssocLost
Definition: TestOutliers.cc:90
TH1F * goodst1_simvecsize
TH1F * goodst2lt4_simvecsize
Definition: TestOutliers.cc:97
TH1F * goodbadmergedLost
TH1F * goodst1gteq4_simvecsize
Definition: TestOutliers.cc:96
TH1F * goodprj_simvecsize
TH1F * okcutsOut
Definition: TestOutliers.cc:91
TFile * file
Definition: TestOutliers.cc:83
TH1F * deltahitsNO
Definition: TestOutliers.cc:90
TH1F * energyLossRatio
TH1F * histoPtOut
Definition: TestOutliers.cc:84
TH1F * hitsPerTrackAssocGained
Definition: TestOutliers.cc:90
TH1F * process
Definition: TestOutliers.cc:92
TH1F * goodst2_simvecsize
TH1F * probYdelta
TH1F * energyLossMax
TH1F * probYgood
TH1F * badhittype
Definition: TestOutliers.cc:93
TH1F * goodlayer_clgteq4
Definition: TestOutliers.cc:93
TH1F * mergedhittype
TH1F * energyLoss
TH1F * deltahits
Definition: TestOutliers.cc:90
TH1F * histoD0Old
Definition: TestOutliers.cc:87
TH1F * probYshared
TH1F * goodprocess
Definition: TestOutliers.cc:92
TH1F * goodhittype_simvecsmall
TH1F * goodpix_clustersize
Definition: TestOutliers.cc:99
TH1F * goodprjgteq4_simvecsize
Definition: TestOutliers.cc:98
TH1F * badlayer
Definition: TestOutliers.cc:93
TH1F * goodst1_clustersize
TH1F * goodpixgteq4_simvecsize
Definition: TestOutliers.cc:95
TH1F * histoPhiOld
Definition: TestOutliers.cc:86
TH1F * badcluster
Definition: TestOutliers.cc:92
TH1F * probXgood
TH1F * countOutA
TH1F * goodprjlt4_simvecsize
Definition: TestOutliers.cc:98
TH1F * goodpix_simvecsize
TH1F * goodlayer
Definition: TestOutliers.cc:93
TH1F * badprocess
Definition: TestOutliers.cc:92
TH1F * histoPhiOut
Definition: TestOutliers.cc:86
std::string out
Definition: TestOutliers.cc:82
TH1F * goodlayer_simvecsmall
TH1F * goodhittype_simvecbig
TH1F * probXnoshare
TH1F * probYnoshare
TH1F * mergedlayer
TH1F * deltahitsOK
Definition: TestOutliers.cc:90
TH1F * goodst1lt4_simvecsize
Definition: TestOutliers.cc:96
TH1F * histoPtOld
Definition: TestOutliers.cc:84
TH1F * goodhittype_clgteq4
Definition: TestOutliers.cc:93
TH1F * deltahitsAssocGained
Definition: TestOutliers.cc:90
const T & get() const
Definition: EventSetup.h:55
TH1F * goodlayer_cllt4
Definition: TestOutliers.cc:93
TH1F * histoDzOut
Definition: TestOutliers.cc:88
TH1F * probXdelta
TH1F * goodst2_clustersize
TH1F * histoLambdaOld
Definition: TestOutliers.cc:89
TH1F * countOldT
TH1F * countOutT
TH1F * goodst2gteq4_simvecsize
Definition: TestOutliers.cc:97
TH1F * goodcluster
Definition: TestOutliers.cc:92
TH1F * histoD0Out
Definition: TestOutliers.cc:87
edm::ESHandle< TrackerGeometry > theG
Definition: TestOutliers.cc:81
TH1F * okcutsOld
Definition: TestOutliers.cc:91
TH1F * mergedPull
TH1F * goodbadmerged
TH1F * deltahitsAssocLost
Definition: TestOutliers.cc:90
TH1F * goodlayer_simvecbig
TH1F * histoQoverpOld
Definition: TestOutliers.cc:85
TH1F * nOfTrackIds
TH1F * hitsPerTrackLost
Definition: TestOutliers.cc:90
TH1F * gainedhits
TH1F * goodbadhits
Definition: TestOutliers.cc:92
TH1F * goodbadmergedGained
TH1F * gainedhits2
void TestOutliers::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 1003 of file TestOutliers.cc.

References file, and LogTrace.

1003  {
1004  LogTrace("TestOutliers") << "TestOutliers::endJob";
1005  file->Write();
1006  LogTrace("TestOutliers") << "outfile written";
1007  file->Close();
1008  LogTrace("TestOutliers") << "oufile closed";
1009  LogTrace("TestOutliers") << "exiting TestOutliers::endJob";
1010 }
TFile * file
Definition: TestOutliers.cc:83
#define LogTrace(id)

Member Data Documentation

TH1F * TestOutliers::badcluster
private

Definition at line 92 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::badhittype
private

Definition at line 93 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::badlayer
private

Definition at line 93 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::badprocess
private

Definition at line 92 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::countOldT
private

Definition at line 110 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::countOutA
private

Definition at line 110 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::countOutT
private

Definition at line 110 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::deltahits
private

Definition at line 90 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::deltahitsAssocGained
private

Definition at line 90 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::deltahitsAssocLost
private

Definition at line 90 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::deltahitsNO
private

Definition at line 90 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::deltahitsOK
private

Definition at line 90 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::energyLoss
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::energyLossMax
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::energyLossRatio
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TFile* TestOutliers::file
private

Definition at line 83 of file TestOutliers.cc.

Referenced by beginRun(), and endJob().

TH1F* TestOutliers::gainedhits
private

Definition at line 111 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::gainedhits2
private

Definition at line 111 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodbadhits
private

Definition at line 92 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodbadmerged
private

Definition at line 107 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodbadmergedGained
private

Definition at line 107 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodbadmergedLost
private

Definition at line 107 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodcluster
private

Definition at line 92 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodhittype
private

Definition at line 93 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodhittype_clgteq4
private

Definition at line 93 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodhittype_cllt4
private

Definition at line 93 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodhittype_simvecbig
private

Definition at line 107 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodhittype_simvecsmall
private

Definition at line 107 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodlayer
private

Definition at line 93 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodlayer_clgteq4
private

Definition at line 93 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodlayer_cllt4
private

Definition at line 93 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodlayer_simvecbig
private

Definition at line 107 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodlayer_simvecsmall
private

Definition at line 107 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodpix_clustersize
private

Definition at line 99 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodpix_simvecsize
private

Definition at line 103 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodpixgteq4_simvecsize
private

Definition at line 95 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodpixlt4_simvecsize
private

Definition at line 95 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodprj_clustersize
private

Definition at line 102 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodprj_simvecsize
private

Definition at line 106 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodprjgteq4_simvecsize
private

Definition at line 98 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodprjlt4_simvecsize
private

Definition at line 98 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodprocess
private

Definition at line 92 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodst1_clustersize
private

Definition at line 100 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodst1_simvecsize
private

Definition at line 104 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodst1gteq4_simvecsize
private

Definition at line 96 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodst1lt4_simvecsize
private

Definition at line 96 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodst2_clustersize
private

Definition at line 101 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodst2_simvecsize
private

Definition at line 105 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodst2gteq4_simvecsize
private

Definition at line 97 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodst2lt4_simvecsize
private

Definition at line 97 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::histoD0Old
private

Definition at line 87 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::histoD0Out
private

Definition at line 87 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::histoDzOld
private

Definition at line 88 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::histoDzOut
private

Definition at line 88 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::histoLambdaOld
private

Definition at line 89 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::histoLambdaOut
private

Definition at line 89 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::histoPhiOld
private

Definition at line 86 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::histoPhiOut
private

Definition at line 86 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::histoPtOld
private

Definition at line 84 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::histoPtOut
private

Definition at line 84 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::histoQoverpOld
private

Definition at line 85 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::histoQoverpOut
private

Definition at line 85 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TrackerHitAssociator* TestOutliers::hitAssociator
private

Definition at line 80 of file TestOutliers.cc.

Referenced by analyze().

TH1F * TestOutliers::hitsPerTrackAssocGained
private

Definition at line 90 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::hitsPerTrackAssocLost
private

Definition at line 90 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::hitsPerTrackGained
private

Definition at line 90 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::hitsPerTrackLost
private

Definition at line 90 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::mergedcluster
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::mergedhittype
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::mergedlayer
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::mergedPull
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::nOfTrackIds
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::okcutsOld
private

Definition at line 91 of file TestOutliers.cc.

Referenced by beginRun().

TH1F* TestOutliers::okcutsOut
private

Definition at line 91 of file TestOutliers.cc.

Referenced by beginRun().

std::string TestOutliers::out
private

Definition at line 82 of file TestOutliers.cc.

Referenced by beginRun().

TH2F* TestOutliers::posxy
private

Definition at line 94 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH2F * TestOutliers::poszr
private

Definition at line 94 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probXbad
private

Definition at line 112 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probXdelta
private

Definition at line 112 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::probXgood
private

Definition at line 112 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probXnoshare
private

Definition at line 112 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probXshared
private

Definition at line 112 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probYbad
private

Definition at line 113 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probYdelta
private

Definition at line 113 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::probYgood
private

Definition at line 113 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probYnoshare
private

Definition at line 113 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probYshared
private

Definition at line 113 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::process
private
edm::ParameterSet TestOutliers::psetold
private

Definition at line 114 of file TestOutliers.cc.

Referenced by analyze(), and TestOutliers().

edm::ParameterSet TestOutliers::psetout
private

Definition at line 114 of file TestOutliers.cc.

Referenced by analyze(), and TestOutliers().

TH1F * TestOutliers::sizeOld
private

Definition at line 109 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::sizeOldT
private

Definition at line 109 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::sizeOut
private

Definition at line 109 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::sizeOutT
private

Definition at line 109 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TrackAssociatorBase* TestOutliers::theAssociatorOld
private

Definition at line 77 of file TestOutliers.cc.

Referenced by analyze().

TrackAssociatorBase* TestOutliers::theAssociatorOut
private

Definition at line 78 of file TestOutliers.cc.

Referenced by analyze().

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

Definition at line 81 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

edm::InputTag TestOutliers::tpTags_
private

Definition at line 76 of file TestOutliers.cc.

Referenced by analyze().

TH1F* TestOutliers::tracks
private

Definition at line 92 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

edm::InputTag TestOutliers::trackTagsOld_
private

Definition at line 75 of file TestOutliers.cc.

Referenced by analyze().

edm::InputTag TestOutliers::trackTagsOut_
private

Definition at line 74 of file TestOutliers.cc.

Referenced by analyze().