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

Public Member Functions

 TestOutliers (const edm::ParameterSet &)
 
 ~TestOutliers ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, 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
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

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

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

Definition at line 58 of file TestOutliers.cc.

Constructor & Destructor Documentation

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

Definition at line 125 of file TestOutliers.cc.

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

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

Definition at line 148 of file TestOutliers.cc.

149 {
150 
151  // do anything here that needs to be done at desctruction time
152  // (e.g. close files, deallocate resources etc.)
153 
154 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 163 of file TestOutliers.cc.

References abs, TrackerHitAssociator::associateHit(), TrackerHitAssociator::associateHitId(), TrackAssociatorBase::associateRecoToSim(), badcluster, badhittype, badlayer, badprocess, SiPixelRawToDigiRegional_cfi::beamSpot, TrajectoryStateClosestToPoint::charge(), reco::TrackBase::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(), 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, 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(), findQualityFiles::v, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 998 of file TestOutliers.cc.

References file, and LogTrace.

998  {
999  LogTrace("TestOutliers") << "TestOutliers::endJob";
1000  file->Write();
1001  LogTrace("TestOutliers") << "outfile written";
1002  file->Close();
1003  LogTrace("TestOutliers") << "oufile closed";
1004  LogTrace("TestOutliers") << "exiting TestOutliers::endJob";
1005 }
TFile * file
Definition: TestOutliers.cc:79
#define LogTrace(id)

Member Data Documentation

TH1F * TestOutliers::badcluster
private

Definition at line 88 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::badhittype
private

Definition at line 89 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::badlayer
private

Definition at line 89 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::badprocess
private

Definition at line 88 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::countOldT
private

Definition at line 106 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::countOutA
private

Definition at line 106 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::countOutT
private

Definition at line 106 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::deltahits
private

Definition at line 86 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::deltahitsAssocGained
private

Definition at line 86 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::deltahitsAssocLost
private

Definition at line 86 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::deltahitsNO
private

Definition at line 86 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::deltahitsOK
private

Definition at line 86 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::energyLoss
private

Definition at line 104 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::energyLossMax
private

Definition at line 104 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::energyLossRatio
private

Definition at line 104 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TFile* TestOutliers::file
private

Definition at line 79 of file TestOutliers.cc.

Referenced by beginRun(), and endJob().

TH1F* TestOutliers::gainedhits
private

Definition at line 107 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::gainedhits2
private

Definition at line 107 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodbadhits
private

Definition at line 88 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodbadmerged
private

Definition at line 103 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodbadmergedGained
private

Definition at line 103 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodbadmergedLost
private

Definition at line 103 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodcluster
private

Definition at line 88 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodhittype
private

Definition at line 89 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodhittype_clgteq4
private

Definition at line 89 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodhittype_cllt4
private

Definition at line 89 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodhittype_simvecbig
private

Definition at line 103 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodhittype_simvecsmall
private

Definition at line 103 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodlayer
private

Definition at line 89 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodlayer_clgteq4
private

Definition at line 89 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodlayer_cllt4
private

Definition at line 89 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodlayer_simvecbig
private

Definition at line 103 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodlayer_simvecsmall
private

Definition at line 103 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodpix_clustersize
private

Definition at line 95 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodpix_simvecsize
private

Definition at line 99 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodpixgteq4_simvecsize
private

Definition at line 91 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodpixlt4_simvecsize
private

Definition at line 91 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodprj_clustersize
private

Definition at line 98 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodprj_simvecsize
private

Definition at line 102 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodprjgteq4_simvecsize
private

Definition at line 94 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodprjlt4_simvecsize
private

Definition at line 94 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodprocess
private

Definition at line 88 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodst1_clustersize
private

Definition at line 96 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodst1_simvecsize
private

Definition at line 100 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodst1gteq4_simvecsize
private

Definition at line 92 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodst1lt4_simvecsize
private

Definition at line 92 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodst2_clustersize
private

Definition at line 97 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodst2_simvecsize
private

Definition at line 101 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::goodst2gteq4_simvecsize
private

Definition at line 93 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::goodst2lt4_simvecsize
private

Definition at line 93 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::histoD0Old
private

Definition at line 83 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::histoD0Out
private

Definition at line 83 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::histoDzOld
private

Definition at line 84 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::histoDzOut
private

Definition at line 84 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::histoLambdaOld
private

Definition at line 85 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::histoLambdaOut
private

Definition at line 85 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::histoPhiOld
private

Definition at line 82 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::histoPhiOut
private

Definition at line 82 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::histoPtOld
private

Definition at line 80 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::histoPtOut
private

Definition at line 80 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::histoQoverpOld
private

Definition at line 81 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::histoQoverpOut
private

Definition at line 81 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TrackerHitAssociator* TestOutliers::hitAssociator
private

Definition at line 76 of file TestOutliers.cc.

Referenced by analyze().

TH1F * TestOutliers::hitsPerTrackAssocGained
private

Definition at line 86 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::hitsPerTrackAssocLost
private

Definition at line 86 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::hitsPerTrackGained
private

Definition at line 86 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::hitsPerTrackLost
private

Definition at line 86 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::mergedcluster
private

Definition at line 104 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::mergedhittype
private

Definition at line 104 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::mergedlayer
private

Definition at line 104 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::mergedPull
private

Definition at line 104 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::nOfTrackIds
private

Definition at line 104 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::okcutsOld
private

Definition at line 87 of file TestOutliers.cc.

Referenced by beginRun().

TH1F* TestOutliers::okcutsOut
private

Definition at line 87 of file TestOutliers.cc.

Referenced by beginRun().

std::string TestOutliers::out
private

Definition at line 78 of file TestOutliers.cc.

Referenced by beginRun().

TH2F* TestOutliers::posxy
private

Definition at line 90 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH2F * TestOutliers::poszr
private

Definition at line 90 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probXbad
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probXdelta
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::probXgood
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probXnoshare
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probXshared
private

Definition at line 108 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probYbad
private

Definition at line 109 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probYdelta
private

Definition at line 109 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::probYgood
private

Definition at line 109 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probYnoshare
private

Definition at line 109 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::probYshared
private

Definition at line 109 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

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

Definition at line 110 of file TestOutliers.cc.

Referenced by analyze(), and TestOutliers().

edm::ParameterSet TestOutliers::psetout
private

Definition at line 110 of file TestOutliers.cc.

Referenced by analyze(), and TestOutliers().

TH1F * TestOutliers::sizeOld
private

Definition at line 105 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::sizeOldT
private

Definition at line 105 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F* TestOutliers::sizeOut
private

Definition at line 105 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TH1F * TestOutliers::sizeOutT
private

Definition at line 105 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

TrackAssociatorBase* TestOutliers::theAssociatorOld
private

Definition at line 73 of file TestOutliers.cc.

Referenced by analyze().

TrackAssociatorBase* TestOutliers::theAssociatorOut
private

Definition at line 74 of file TestOutliers.cc.

Referenced by analyze().

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

Definition at line 77 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

edm::InputTag TestOutliers::tpTags_
private

Definition at line 72 of file TestOutliers.cc.

Referenced by analyze().

TH1F* TestOutliers::tracks
private

Definition at line 88 of file TestOutliers.cc.

Referenced by analyze(), and beginRun().

edm::InputTag TestOutliers::trackTagsOld_
private

Definition at line 71 of file TestOutliers.cc.

Referenced by analyze().

edm::InputTag TestOutliers::trackTagsOut_
private

Definition at line 70 of file TestOutliers.cc.

Referenced by analyze().