69 : tracksToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"src"))),
70 aliClusterToken_(consumes(iConfig.getParameter<
edm::
InputTag>(
"assomap"))),
71 prescfilename_(iConfig.getParameter<
std::
string>(
"PrescFileName")),
72 presctreename_(iConfig.getParameter<
std::
string>(
"PrescTreeName")) {
74 produces<AliClusterValueMap>();
75 produces<AliTrackTakenClusterValueMap>();
82 edm::LogPrint(
"AlignmentPrescaler") <<
"in AlignmentPrescaler::beginJob" << std::flush;
86 tpresc_->SetBranchStatus(
"*",
false);
87 tpresc_->SetBranchStatus(
"DetId",
true);
88 tpresc_->SetBranchStatus(
"PrescaleFactor",
true);
89 tpresc_->SetBranchStatus(
"PrescaleFactorOverlap",
true);
90 edm::LogPrint(
"AlignmentPrescaler") <<
" Branches activated " << std::flush;
98 edm::LogPrint(
"AlignmentPrescaler") <<
" addressed " << std::flush;
112 LogDebug(
"AlignmentPrescaler") <<
"\n\n#################\n### Starting the AlignmentPrescaler::produce ; Event: " 113 <<
iEvent.id().run() <<
", " <<
iEvent.id().event() << std::endl;
122 std::vector<int> trackflags(
Tracks->size(), 0);
125 for (std::vector<reco::Track>::const_iterator ittrk =
Tracks->begin(), edtrk =
Tracks->end(); ittrk != edtrk;
128 LogDebug(
"AlignmentPrescaler") <<
"Loop on hits of track #" << (ittrk -
Tracks->begin()) << std::endl;
130 bool firstTakenHit =
false;
132 for (
auto const&
hit : ittrk->recHits()) {
133 if (!
hit->isValid()) {
136 uint32_t tmpdetid =
hit->geographicalId().rawId();
137 tpresc_->GetEntryWithIndex(tmpdetid);
142 int subdetId =
hit->geographicalId().subdetId();
145 bool isOverlapHit =
false;
155 const std::type_info&
type =
typeid(*hit);
163 if (stripType == 1) {
166 if (stripHit1D !=
nullptr) {
168 tmpflag = InValMap[stripclust];
169 tmpflag.SetDetId(
hit->geographicalId());
170 if (tmpflag.isOverlap())
173 <<
"~*~*~* Prescale (1D) for module " << tmpflag.detId().rawId() <<
"(" 174 << InValMap[stripclust].detId().rawId() <<
") is " <<
hitPrescFactor_ << std::flush;
175 if (tmpflag.isOverlap())
176 LogDebug(
"AlignmentPrescaler") <<
" (it is Overlap)";
178 }
else if (stripType == 2) {
180 if (stripHit2D !=
nullptr) {
182 tmpflag = InValMap[stripclust];
183 tmpflag.SetDetId(
hit->geographicalId());
184 if (tmpflag.isOverlap())
187 <<
"~*~*~* Prescale (2D) for module " << tmpflag.detId().rawId() <<
"(" 188 << InValMap[stripclust].detId().rawId() <<
") is " <<
hitPrescFactor_ << std::flush;
189 if (tmpflag.isOverlap())
190 LogDebug(
"AlignmentPrescaler") <<
" (it is Overlap)" << endl;
198 tmpflag = InValMap[pixclust];
199 tmpflag.SetDetId(
hit->geographicalId());
200 if (tmpflag.isOverlap())
207 LogDebug(
"AlignmentPrescaler") <<
" DetId=" << tmpdetid <<
" is Overlap! " << flush;
215 LogDebug(
"AlignmentPrescaler") <<
" DetId=" << tmpdetid <<
" taken!" << flush;
216 tmpflag.SetTakenFlag();
219 if (stripType == 1) {
221 InValMap[stripclust] = tmpflag;
222 }
else if (stripType == 2) {
224 InValMap[stripclust] = tmpflag;
226 std::cout <<
"Unknown type of strip hit" << std::endl;
229 InValMap[pixclust] = tmpflag;
232 if (!firstTakenHit) {
233 firstTakenHit =
true;
234 LogDebug(
"AlignmentPrescaler") <<
"Index of the track iterator is " << ittrk -
Tracks->begin();
239 trackflags[ittrk -
Tracks->begin()] = ntakenhits;
244 auto OutVM = std::make_unique<AliClusterValueMap>();
249 auto trkVM = std::make_unique<AliTrackTakenClusterValueMap>();
251 trkmapfiller.insert(
Tracks, trackflags.begin(), trackflags.end());
276 desc.setComment(
"Prescale Tracker Alignment hits for alignment procedures");
static constexpr auto TEC
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
unsigned int tobLayer(const DetId &id) const
unsigned int pxbLayer(const DetId &id) const
int layerFromId(const DetId &id, const TrackerTopology *tTopo) const
AlignmentPrescaler(const edm::ParameterSet &iConfig)
unsigned int tidSide(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
~AlignmentPrescaler() override
void produce(edm::Event &iEvent, const edm::EventSetup &iSetup) override
ClusterRef cluster() const
float overlapPrescFactor_
unsigned int pxfDisk(const DetId &id) const
#define DEFINE_FWK_MODULE(type)
std::string prescfilename_
static constexpr auto TOB
std::string presctreename_
edm::EDGetTokenT< AliClusterValueMap > aliClusterToken_
static void fillDescriptions(edm::ConfigurationDescriptions &)
Log< level::Warning, true > LogPrint
edm::EDGetTokenT< reco::TrackCollection > tracksToken_
unsigned int pxfSide(const DetId &id) const
static constexpr auto TIB
unsigned int tibLayer(const DetId &id) const
ClusterRef cluster() const
static constexpr auto TID