![]() |
![]() |
00001 #ifndef CosmicTrackFinder_h 00002 #define CosmicTrackFinder_h 00003 00004 // Package: RecoTracker/SingleTrackPattern 00005 // Class: CosmicTrackFinder 00006 // Original Author: Michele Pioppi-INFN perugia 00007 00008 00009 #include "FWCore/Framework/interface/EDProducer.h" 00010 #include "FWCore/Framework/interface/Event.h" 00011 #include "DataFormats/Common/interface/Handle.h" 00012 #include "FWCore/Framework/interface/EventSetup.h" 00013 #include "RecoTracker/SingleTrackPattern/interface/CosmicTrajectoryBuilder.h" 00014 #include "RecoTracker/SingleTrackPattern/interface/CRackTrajectoryBuilder.h" 00015 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00016 #include "TrackingTools/PatternTools/interface/Trajectory.h" 00017 #include "TrackingTools/TransientTrackingRecHit/interface/TransientTrackingRecHit.h" 00018 00019 namespace cms 00020 { 00021 class CompareTrajLay { 00022 public: 00023 bool operator()(Trajectory *t1, 00024 Trajectory *t2){ 00025 AnalHits(t1->recHits()); 00026 unsigned int alay=nlay; 00027 AnalHits(t2->recHits()); 00028 unsigned int blay=nlay; 00029 if (alay!=blay) return alay > blay; 00030 if (t1->foundHits() != t2->foundHits()) 00031 return t1->foundHits()> t2->foundHits(); 00032 return t1->chiSquared()< t2->chiSquared(); 00033 // std::cout<<"chi "<<t1.chiSquared()<<" "<<t2.chiSquared()<<std::endl; 00034 // return false; 00035 } 00036 void AnalHits(std::vector< ConstReferenceCountingPointer< TransientTrackingRecHit> > hits){ 00037 ltob1=false; ltob2=false; ltib1=false; ltib2=false; 00038 std::vector< ConstReferenceCountingPointer< TransientTrackingRecHit> >::const_iterator hit; 00039 // ConstRecHitIterator hit; 00040 for(hit=hits.begin();hit!=hits.end();hit++){ 00041 unsigned int iid=(*hit)->hit()->geographicalId().rawId(); 00042 00043 int sub=(iid>>25)&0x7 ; 00044 int lay=(iid>>16) & 0xF; 00045 if ((lay==1)&&(sub==3)) ltib1=true; 00046 if ((lay==2)&&(sub==3)) ltib2=true; 00047 if ((lay==1)&&(sub==5)) ltob1=true; 00048 if ((lay==2)&&(sub==5)) ltob2=true; 00049 } 00050 nlay=ltib1+ltib2+ltob1+ltob2; 00051 00052 } 00053 00054 private: 00055 bool ltib1,ltib2,ltob1,ltob2; 00056 unsigned int nlay; 00057 00058 }; 00059 class CompareTrajChi { 00060 public: 00061 bool operator()(Trajectory *t1, 00062 Trajectory *t2){ 00063 if (t1->foundHits() != t2->foundHits()) 00064 return t1->foundHits()> t2->foundHits(); 00065 return t1->chiSquared()< t2->chiSquared(); 00066 } 00067 }; 00068 class CosmicTrackFinder : public edm::EDProducer 00069 { 00070 00071 typedef TrajectoryStateOnSurface TSOS; 00072 public: 00073 00074 explicit CosmicTrackFinder(const edm::ParameterSet& conf); 00075 00076 virtual ~CosmicTrackFinder(); 00077 00078 virtual void produce(edm::Event& e, const edm::EventSetup& c); 00079 00080 private: 00081 CosmicTrajectoryBuilder cosmicTrajectoryBuilder_; 00082 CRackTrajectoryBuilder crackTrajectoryBuilder_; 00083 edm::ParameterSet conf_; 00084 std::string geometry; 00085 bool trinevents; 00086 bool useHitsSplitting_; 00087 }; 00088 } 00089 00090 #endif