25 vector<CSCAnodeLayerInfo> alctInfo = lctDigis(alct, alctId, wiredc);
29 throw cms::Exception(
"CSCAnodeLCTAnalyzer") <<
"+++ Number of CSCAnodeLayerInfo objects, " << alctInfo.size()
41 vector<CSCAnodeLayerInfo>::iterator pali;
42 for (pali = alctInfo.begin(); pali != alctInfo.end(); pali++) {
43 digiSimHitAssociator(*pali, allSimHits);
57 vector<CSCAnodeLayerInfo> vectInfo;
64 int alct_bx = alct.
getBX();
67 int MESelection = (alctId.
station() < 3) ? 0 : 1;
70 LogDebug(
"lctDigis") <<
"\nlctDigis: ALCT keywire = " << alct_keywire <<
"; alctId:"
71 <<
" endcap " << alctId.
endcap() <<
", station " << alctId.
station() <<
", ring "
72 << alctId.
ring() <<
", chamber " << alctId.
chamber();
76 map<int, CSCWireDigi> digiMap;
85 preselectDigis(alct_bx, layerId, wiredc, digiMap);
93 preselectDigis(alct_bx, layerId_me1a, wiredc, digiMap);
106 if (digiMap.count(wire) > 0) {
107 tempInfo.
setId(layerId);
110 LogDebug(
"lctDigis") <<
" Digi on ALCT: wire group " << digiMap[wire].getWireGroup();
119 vectInfo.push_back(tempInfo);
128 map<int, CSCWireDigi>& digiMap) {
133 const int fifo_tbins = 16;
134 const int drift_delay = 2;
135 const int hit_persist = 6;
140 LogDebug(
"lctDigis") <<
"Wire digi: layer " << layerId.
layer() - 1 << (*digiIt);
141 int bx_time = (*digiIt).getTimeBin();
142 if (bx_time >= 0 && bx_time < fifo_tbins) {
144 int latch_bx = alct_bx + drift_delay;
145 if (bx_time <= latch_bx - hit_persist || bx_time > latch_bx) {
147 LogDebug(
"lctDigis") <<
"Late wire digi: layer " << layerId.
layer() - 1 <<
" " << (*digiIt) <<
" skipping...";
151 int i_wire = (*digiIt).getWireGroup() - 1;
155 if (digiMap.count(i_wire) > 0) {
156 if (digiMap[i_wire].getTimeBin() > bx_time) {
158 LogDebug(
"lctDigis") <<
" Replacing good wire digi on wire " << i_wire;
160 digiMap.erase(i_wire);
164 digiMap[i_wire] = *digiIt;
166 LogDebug(
"lctDigis") <<
" Good wire digi: wire group " << i_wire;
179 vector<CSCWireDigi> thisLayerDigis =
info.getRecDigis();
180 if (!thisLayerDigis.empty()) {
182 bool me11 = (layerId.
station() == 1) && (layerId.
ring() == 1);
185 for (edm::PSimHitContainer::const_iterator simHitIt = allSimHits->begin(); simHitIt != allSimHits->end();
189 if (hitId == layerId)
193 if (hitId == layerId_me1a)
199 ostringstream strstrm;
201 strstrm <<
"\nLayer " << layerId.
layer() <<
" has " <<
simHits.size() <<
" SimHit(s); eta value(s) = ";
205 for (vector<CSCWireDigi>::const_iterator
prd = thisLayerDigis.begin();
prd != thisLayerDigis.end();
prd++) {
206 double deltaEtaMin = 999.;
207 double bestHitEta = 999.;
210 int wiregroup =
prd->getWireGroup();
211 double digiEta = getWGEta(layerId, wiregroup - 1);
213 const CSCLayer* csclayer = geom_->layer(layerId);
214 for (vector<PSimHit>::iterator psh =
simHits.begin(); psh !=
simHits.end(); psh++) {
218 double hitEta = hitGP.
eta();
220 strstrm << hitEta <<
" ";
222 double deltaEta = fabs(hitEta - digiEta);
230 strstrm <<
"\nDigi eta: " << digiEta <<
", closest SimHit eta: " << bestHitEta
234 info.addComponent(*bestHit);
237 LogDebug(
"digiSimHitAssociator") << strstrm.str();
245 double& closestEta) {
251 int nearestWG = -999;
253 bool hit_found =
false;
256 vector<CSCAnodeLayerInfo>::const_iterator pli;
257 for (pli = allLayerInfo.begin(); pli != allLayerInfo.end(); pli++) {
260 vector<PSimHit> thisLayerHits = pli->getSimHits();
261 if (!thisLayerHits.empty()) {
264 if (thisLayerHits.size() != 1) {
268 for (
unsigned i = 0;
i < thisLayerHits.size();
i++) {
269 edm::LogWarning(
"L1CSCTPEmulatorWrongValues") <<
" SimHit # " <<
i << thisLayerHits[
i] <<
"\n";
272 matchedHit = thisLayerHits[0];
273 layerId = pli->getId();
281 for (pli = allLayerInfo.begin(); pli != allLayerInfo.end(); pli++) {
283 if (!(pli->getRecDigis()).
empty() && !(pli->getSimHits()).
empty()) {
285 vector<PSimHit> thisLayerHits = pli->getSimHits();
286 matchedHit = thisLayerHits[0];
287 layerId = pli->getId();
296 const CSCLayer* csclayer = geom_->layer(layerId);
299 nearestWG = layerGeom->
wireGroup(nearestW);
306 <<
") interval +++\n";
310 closestPhi = thisPoint.
phi();
311 closestEta = thisPoint.
eta();
312 ostringstream strstrm;
314 strstrm <<
"Matched anode phi: " << closestPhi;
315 if (closestPhi < 0.) {
316 closestPhi += 2. *
M_PI;
318 strstrm <<
" (" << closestPhi <<
")";
321 strstrm <<
" eta: " << closestEta <<
" on a layer " << layerId.
layer() <<
" (1-6);"
322 <<
" nearest wire group: " << nearestWG;
323 LogDebug(
"nearestWG") << strstrm.str();
335 edm::LogWarning(
"L1CSCTPEmulatorWrongInput") <<
"+++ Warning: wire group, " << wiregroup <<
", is not in [0-"
339 const CSCLayer* csclayer = geom_->layer(layerId);
347 double eta = digiGP.
eta();