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