27 #include "Riostream.h"
30 src_(iConfig.getParameter<edm::InputTag>(
"src")),
31 srcQualityMap_(iConfig.getParameter<edm::InputTag>(
"assomap")),
32 prescfilename_(iConfig.getParameter<std::string>(
"PrescFileName")),
33 presctreename_(iConfig.getParameter<std::string>(
"PrescTreeName"))
36 produces<AliClusterValueMap>();
37 produces<AliTrackTakenClusterValueMap>();
47 std::cout<<
"in AlignmentPrescaler::beginJob"<<std::flush;
50 tpresc_->BuildIndex(
"DetId");
51 tpresc_->SetBranchStatus(
"*",0);
52 tpresc_->SetBranchStatus(
"DetId",1);
53 tpresc_->SetBranchStatus(
"PrescaleFactor",1);
54 tpresc_->SetBranchStatus(
"PrescaleFactorOverlap",1);
55 cout<<
" Branches activated "<<std::flush;
60 tpresc_->SetBranchAddress(
"DetId",&
detid_);
63 cout<<
" addressed "<<std::flush;
66 cout<<
" ok "<<std::endl;
89 std::vector<int> trackflags(Tracks->size(),0);
95 for(std::vector<reco::Track>::const_iterator ittrk = Tracks->begin(), edtrk = Tracks->end(); ittrk != edtrk; ++ittrk){
100 bool firstTakenHit=
false;
109 tpresc_->GetEntryWithIndex(tmpdetid);
119 bool isOverlapHit=
false;
123 const SiStripRecHit1D* stripHit1D =
dynamic_cast<const SiStripRecHit1D*
>(hit);
124 const SiStripRecHit2D* stripHit2D =
dynamic_cast<const SiStripRecHit2D*
>(hit);
129 const std::type_info &
type =
typeid(*hit);
130 if (type ==
typeid(SiStripRecHit1D)) stripType=1;
131 else if (type ==
typeid(SiStripRecHit2D)) stripType=2;
138 SiStripRecHit1D::ClusterRef stripclust(stripHit1D->cluster());
139 tmpflag=InValMap[stripclust];
141 if(tmpflag.isOverlap())isOverlapHit=
true;
148 else if (stripType==2) {
151 SiStripRecHit2D::ClusterRef stripclust(stripHit2D->cluster());
152 tmpflag=InValMap[stripclust];
154 if(tmpflag.isOverlap())isOverlapHit=
true;
167 tmpflag=InValMap[pixclust];
169 if(tmpflag.isOverlap())isOverlapHit=
true;
184 tmpflag.SetTakenFlag();
188 SiStripRecHit1D::ClusterRef stripclust(stripHit1D->cluster());
189 InValMap[stripclust]=tmpflag;
191 else if(stripType==2){
192 SiStripRecHit1D::ClusterRef stripclust(stripHit2D->cluster());
193 InValMap[stripclust]=tmpflag;
195 else std::cout<<
"Unknown type of strip hit"<<std::endl;
199 InValMap[pixclust]=tmpflag;
214 trackflags[ittrk-Tracks->begin()]=ntakenhits;
235 trkmapfiller.
insert(Tracks,trackflags.begin(),trackflags.end() );
247 return tobId.
layer();
251 return tobId.
disk() + (3*(tobId.
side()-1));
255 return tibId.
layer();
259 return tobId.
layer();
263 return tobId.
wheel() + (9*(tobId.
side()-1));
267 return tobId.
wheel() + (3*(tobId.
side()-1));
unsigned int layer() const
layer id
AlignmentPrescaler(const edm::ParameterSet &iConfig)
#define DEFINE_FWK_MODULE(type)
void insert(const H &h, I begin, I end)
int layerFromId(const DetId &id) const
unsigned int layer() const
layer id
unsigned int side() const
positive or negative id
uint32_t rawId() const
get the raw id
edm::InputTag srcQualityMap_
float overlapPrescFactor_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
std::string prescfilename_
std::string presctreename_
int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned int disk() const
disk id
unsigned int side() const
positive or negative id
unsigned int wheel() const
wheel id
unsigned int layer() const
layer id
unsigned int side() const
positive or negative id
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
DetId geographicalId() const
unsigned int wheel() const
wheel id