00001 #ifndef TrackerAlignment_AlignmentPrescaler_H 00002 #define TrackerAlignment_AlignmentPrescaler_H 00003 00004 #include <Riostream.h> 00005 #include <string> 00006 #include "TFile.h" 00007 #include "TTree.h" 00008 #include "TRandom3.h" 00009 #include "TH1F.h" 00010 00011 00012 #include "FWCore/Framework/interface/EDProducer.h" 00013 #include "FWCore/Framework/interface/EventPrincipal.h" 00014 #include "FWCore/Framework/interface/Event.h" 00015 #include "FWCore/Framework/interface/EventSetup.h" 00016 #include "FWCore/Framework/interface/ESHandle.h" 00017 00018 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00019 #include "FWCore/Utilities/interface/InputTag.h" 00020 00021 #include "DataFormats/DetId/interface/DetId.h" 00022 00023 class AlignmentPrescaler : public edm::EDProducer{ 00024 00025 public: 00026 AlignmentPrescaler(const edm::ParameterSet &iConfig); 00027 ~AlignmentPrescaler(); 00028 void beginJob(); 00029 void endJob(); 00030 virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) ; 00031 00032 private: 00033 edm::InputTag src_;//tracks in input 00034 edm::InputTag srcQualityMap_;//Hit-quality association map 00035 00036 std::string prescfilename_;//name of the file containing the TTree with the prescaling factors 00037 std::string presctreename_;//name of the TTree with the prescaling factors 00038 00039 TFile *fpresc_; 00040 TTree *tpresc_; 00041 TRandom3 *myrand_; 00042 00043 00044 int layerFromId (const DetId& id) const; 00045 00046 unsigned int detid_; 00047 float hitPrescFactor_, overlapPrescFactor_; 00048 int totnhitspxl_; 00049 }; 00050 #endif