30 srcQualityMap_(iConfig.getParameter<
edm::
InputTag>(
"assomap")),
31 prescfilename_(iConfig.getParameter<
std::
string>(
"PrescFileName")),
32 presctreename_(iConfig.getParameter<
std::
string>(
"PrescTreeName")) {
34 produces<AliClusterValueMap>();
35 produces<AliTrackTakenClusterValueMap>();
44 std::cout <<
"in AlignmentPrescaler::beginJob" << std::flush;
47 tpresc_->BuildIndex(
"DetId");
48 tpresc_->SetBranchStatus(
"*",
false);
49 tpresc_->SetBranchStatus(
"DetId",
true);
50 tpresc_->SetBranchStatus(
"PrescaleFactor",
true);
51 tpresc_->SetBranchStatus(
"PrescaleFactorOverlap",
true);
52 cout <<
" Branches activated " << std::flush;
57 tpresc_->SetBranchAddress(
"DetId", &
detid_);
60 cout <<
" addressed " << std::flush;
63 cout <<
" ok " << std::endl;
84 std::vector<int> trackflags(Tracks->size(), 0);
89 for (std::vector<reco::Track>::const_iterator ittrk = Tracks->begin(), edtrk = Tracks->end(); ittrk != edtrk;
95 bool firstTakenHit =
false;
97 for (
auto const&
hit : ittrk->recHits()) {
98 if (!
hit->isValid()) {
102 uint32_t tmpdetid =
hit->geographicalId().rawId();
103 tpresc_->GetEntryWithIndex(tmpdetid);
108 int subdetId =
hit->geographicalId().subdetId();
111 bool isOverlapHit =
false;
121 const std::type_info&
type =
typeid(*hit);
129 if (stripType == 1) {
132 if (stripHit1D !=
nullptr) {
134 tmpflag = InValMap[stripclust];
135 tmpflag.SetDetId(
hit->geographicalId());
136 if (tmpflag.isOverlap())
143 }
else if (stripType == 2) {
145 if (stripHit2D !=
nullptr) {
147 tmpflag = InValMap[stripclust];
148 tmpflag.SetDetId(
hit->geographicalId());
149 if (tmpflag.isOverlap())
160 if (pixelhit !=
nullptr) {
163 tmpflag = InValMap[pixclust];
164 tmpflag.SetDetId(
hit->geographicalId());
165 if (tmpflag.isOverlap())
181 tmpflag.SetTakenFlag();
184 if (stripType == 1) {
186 InValMap[stripclust] = tmpflag;
187 }
else if (stripType == 2) {
189 InValMap[stripclust] = tmpflag;
191 std::cout <<
"Unknown type of strip hit" << std::endl;
194 InValMap[pixclust] = tmpflag;
197 if (!firstTakenHit) {
198 firstTakenHit =
true;
208 trackflags[ittrk - Tracks->begin()] = ntakenhits;
217 auto OutVM = std::make_unique<AliClusterValueMap>();
222 auto trkVM = std::make_unique<AliTrackTakenClusterValueMap>();
224 trkmapfiller.insert(Tracks, trackflags.begin(), trackflags.end());
ClusterRef cluster() const
static constexpr auto TEC
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_
static constexpr auto TOB
std::string presctreename_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
unsigned int pxbLayer(const DetId &id) const
static constexpr auto TIB
ClusterRef cluster() const
unsigned int pxfSide(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
static constexpr auto TID
int layerFromId(const DetId &id, const TrackerTopology *tTopo) const
unsigned int tobLayer(const DetId &id) const