30 hist[
i][0]->
Fill(phi);
31 if( hist[
i][1] !=
nullptr) hist[
i][1]->
Fill(phi);
34 hist[
i][0]->
Fill(phi);
35 if( hist[
i][2] !=
nullptr) hist[
i][2]->
Fill(phi);
44 if ( array[
i][0] ) hist[0][
i]->
Fill(value);
45 if ( array[i][1] ) hist[1][
i]->
Fill(value);
46 if ( array[i][0] || array[i][1] ) hist[2][
i]->
Fill(value);
47 if ( array[i][0] && array[i][1] ) hist[3][
i]->
Fill(value);
58 hist[0][
i][0]->
Fill(phi);
59 if ( hist[0][i][1] !=
nullptr) hist[0][
i][1]->
Fill(phi);
62 hist[1][
i][0]->
Fill(phi);
63 if( hist[1][i][1] !=
nullptr ) hist[1][
i][1]->
Fill(phi);
65 if ( array[i][0] || array[i][1] ) {
66 hist[2][
i][0]->
Fill(phi);
67 if ( hist[2][i][1] !=
nullptr) hist[2][
i][1]->
Fill(phi);
69 if ( array[i][0] && array[i][1] ) {
70 hist[3][
i][0]->
Fill(phi);
71 if ( hist[3][i][1] !=
nullptr) hist[3][
i][1]->
Fill(phi);
76 hist[0][
i][0]->
Fill(phi);
77 if ( hist[0][i][2]!=
nullptr) hist[0][
i][2]->
Fill(phi);
80 hist[1][
i][0]->
Fill(phi);
81 if( hist[1][i][2]!=
nullptr ) hist[1][
i][2]->
Fill(phi);
83 if ( array[i][0] || array[i][1] ) {
84 hist[2][
i][0]->
Fill(phi);
85 if( hist[2][i][2]!=
nullptr) hist[2][
i][2]->
Fill(phi);
87 if ( array[i][0] && array[i][1] ) {
88 hist[3][
i][0]->
Fill(phi);
89 if( hist[3][i][2]!=
nullptr) hist[3][
i][2]->
Fill(phi);
100 auto& roll1 = ch->etaPartitions().front();
101 auto& roll2 = ch->etaPartitions()[ch->nEtaPartitions()-1];
102 const BoundPlane& bSurface1(roll1->surface());
103 const BoundPlane& bSurface2(roll2->surface());
104 auto& parameters1( roll1->specs()->parameters());
105 float height1(parameters1[2]);
106 auto& parameters2( roll2->specs()->parameters());
107 float height2(parameters2[2]);
115 GlobalPoint gBottom2(bSurface2.toGlobal(lBottom2));
116 double eta1 = fabs(gTop1.eta()) - 0.01;
117 double eta2 = fabs(gBottom2.eta()) + 0.01;
118 return std::make_pair(eta1,eta2);
120 else {
std::cout<<
"Failed to get geometry information"<<std::endl;
121 return std::make_pair(0,0);
142 edm::LogInfo(
"GEMTrackMatch")<<
"GEMTrackMatch::buildLUT"<<std::endl;
143 edm::LogInfo(
"GEMTrackMatch")<<
"max chamber "<<maxChamberId<<
"\n";
145 std::vector<int> pos_ids, neg_ids;
146 std::vector<float> phis_pos;
147 std::vector<float> phis_neg;
151 if(it->id().region()>0) {
152 pos_ids.push_back(it->id().rawId());
153 edm::LogInfo(
"GEMTrackMatch")<<
"added id = "<<it->id()<<
" = "<<it->id().rawId()<<
" to pos ids"<<std::endl;
156 int cphi(gCentre.phi().degrees());
157 if (cphi < 0) cphi += 360;
158 phis_pos.push_back(cphi);
159 edm::LogInfo(
"GEMTrackMatch")<<
"added phi = "<<cphi<<
" to phi pos vector"<<std::endl;
161 else if(it->id().region()<0) {
162 neg_ids.push_back(it->id().rawId());
163 edm::LogInfo(
"GEMTrackMatch")<<
"added id = "<<it->id()<<
" = "<<it->id().rawId()<<
" to neg ids"<<std::endl;
166 int cphi(gCentre.phi().degrees());
167 if (cphi < 0) cphi += 360;
168 phis_neg.push_back(cphi);
169 edm::LogInfo(
"GEMTrackMatch")<<
"added phi = "<<cphi<<
" to phi neg vector"<<std::endl;
179 edm::LogInfo(
"GEMTrackMatch")<<
"GEMTrackMatch :: setGeometry"<<std::endl;
185 const auto bottom_chamber =
static_cast<const GEMEtaPartition*
>(geom.
idToDetUnit(
GEMDetId(chId.region(),chId.ring(),chId.station(),chId.layer(),chId.chamber(),nEtaPartitions)));
187 const float bottom_half_striplength = bottom_chamber->specs()->specificTopology().stripLength()/2.;
188 const LocalPoint lp_top(0., top_half_striplength, 0.);
189 const LocalPoint lp_bottom(0., -bottom_half_striplength, 0.);
190 const GlobalPoint gp_top = top_chamber->toGlobal(lp_top);
191 const GlobalPoint gp_bottom = bottom_chamber->toGlobal(lp_bottom);
196 const int maxChamberId = geom.
regions()[0]->stations()[0]->superChambers().size();
197 edm::LogInfo(
"GEMTrackMatch")<<
"GEMTrackMatch :: setGeometry --> Calling buildLUT"<<std::endl;
207 return std::make_pair(LUT.at(
upper - phis.begin()), (LUT.at((
upper - phis.begin() + 1)%maxChamberId)));
212 std::pair<double, double> range;
T getUntrackedParameter(std::string const &, T const &) const
virtual float stripLength() const =0
void buildLUT(const int maxChamberId)
std::pair< std::vector< float >, std::vector< int > > negativeLUT_
std::vector< double > etaRangeForPhi
~GEMTrackMatch() override
U second(std::pair< T, U > const &p)
void setGeometry(const GEMGeometry &geom)
const std::vector< const GEMRegion * > & regions() const
Return a vector of all GEM regions.
GEMTrackMatch(const edm::ParameterSet &cfg)
Abs< T >::type abs(const T &t)
std::pair< double, double > getEtaRange(int station, int chamber)
const GeomDet * idToDetUnit(DetId) const override
Return the pointer to the GeomDetUnit corresponding to a given DetId.
void FillWithTrigger(MonitorElement *me[3], Float_t eta)
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
int type() const
particle type (HEP PDT convension)
const GEMGeometry * gem_geom_
std::pair< int, int > getClosestChambers(const int maxChamberId, int region, float phi)
const math::XYZTLorentzVectorD & momentum() const
std::pair< std::vector< float >, std::vector< int > > positiveLUT_
bool isSimTrackGood(const SimTrack &)
std::pair< double, double > getEtaRangeForPhi(int station)
std::vector< unsigned short int > LUT