29 src_(iConfig.getParameter<
edm::InputTag>(
"src")),
30 srcQualityMap_(iConfig.getParameter<
edm::InputTag>(
"assomap")),
31 prescfilename_(iConfig.getParameter<
std::
string>(
"PrescFileName")),
32 presctreename_(iConfig.getParameter<
std::
string>(
"PrescTreeName"))
35 produces<AliClusterValueMap>();
36 produces<AliTrackTakenClusterValueMap>();
46 std::cout<<
"in AlignmentPrescaler::beginJob"<<std::flush;
49 tpresc_->BuildIndex(
"DetId");
50 tpresc_->SetBranchStatus(
"*",
false);
51 tpresc_->SetBranchStatus(
"DetId",
true);
52 tpresc_->SetBranchStatus(
"PrescaleFactor",
true);
53 tpresc_->SetBranchStatus(
"PrescaleFactorOverlap",
true);
54 cout<<
" Branches activated "<<std::flush;
59 tpresc_->SetBranchAddress(
"DetId",&
detid_);
62 cout<<
" addressed "<<std::flush;
65 cout<<
" ok "<<std::endl;
88 std::vector<int> trackflags(Tracks->size(),0);
94 for(std::vector<reco::Track>::const_iterator ittrk = Tracks->begin(), edtrk = Tracks->end(); ittrk != edtrk; ++ittrk){
99 bool firstTakenHit=
false;
101 for(
auto const&
hit : ittrk->recHits()) {
102 if(!
hit->isValid()){
106 uint32_t tmpdetid =
hit->geographicalId().rawId();
107 tpresc_->GetEntryWithIndex(tmpdetid);
113 int subdetId=
hit->geographicalId().subdetId();
117 bool isOverlapHit=
false;
127 const std::type_info &
type =
typeid(*hit);
135 if(stripHit1D!=
nullptr){
137 tmpflag=InValMap[stripclust];
138 tmpflag.SetDetId(
hit->geographicalId());
139 if(tmpflag.isOverlap())isOverlapHit=
true;
146 else if (stripType==2) {
148 if(stripHit2D!=
nullptr){
150 tmpflag=InValMap[stripclust];
151 tmpflag.SetDetId(
hit->geographicalId());
152 if(tmpflag.isOverlap())isOverlapHit=
true;
162 if(pixelhit!=
nullptr){
165 tmpflag=InValMap[pixclust];
166 tmpflag.SetDetId(
hit->geographicalId());
167 if(tmpflag.isOverlap())isOverlapHit=
true;
182 tmpflag.SetTakenFlag();
187 InValMap[stripclust]=tmpflag;
189 else if(stripType==2){
191 InValMap[stripclust]=tmpflag;
193 else std::cout<<
"Unknown type of strip hit"<<std::endl;
197 InValMap[pixclust]=tmpflag;
212 trackflags[ittrk-Tracks->begin()]=ntakenhits;
225 auto OutVM = std::make_unique<AliClusterValueMap>();
231 auto trkVM = std::make_unique<AliTrackTakenClusterValueMap>();
233 trkmapfiller.insert(Tracks,trackflags.begin(),trackflags.end() );
ClusterRef cluster() const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
unsigned int tibLayer(const DetId &id) const
AlignmentPrescaler(const edm::ParameterSet &iConfig)
unsigned int pxfDisk(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
~AlignmentPrescaler() override
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
edm::InputTag srcQualityMap_
#define DEFINE_FWK_MODULE(type)
unsigned int tidSide(const DetId &id) const
float overlapPrescFactor_
ClusterRef cluster() const
std::string prescfilename_
std::string presctreename_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned int pxbLayer(const DetId &id) const
ClusterRef cluster() const
unsigned int pxfSide(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
int layerFromId(const DetId &id, const TrackerTopology *tTopo) const
unsigned int tobLayer(const DetId &id) const