76 unsigned int& nClusGlobal);
125 nearByClustersToken_(
127 trajTrackCollectionToken_(
151 auto const& muonTracks = *muonTrackCollectionHandle;
156 unsigned int nMuons = muonTracks.size();
157 for (
unsigned int ij = 0; ij <
nMuons; ij++) {
158 auto muon = muonTrackCollectionHandle->ptrAt(ij);
160 const auto& distances = (*distancesToTrack)[trackRef];
162 LogDebug(
"NearbyPixelClustersAnalyzer") <<
"distances size: " << distances.size() << std::endl;
165 double closestDR = 999.;
166 for (
const auto&
distance : distances) {
168 LogDebug(
"NearbyPixelClustersAnalyzer")
170 if (distance < closestDR && distance > 0) {
181 unsigned int nClusGlobal = 0;
185 edm::LogInfo(
"NearbyPixelClustersAnalyzer") <<
"total ALCARECO clusters: " << nClusGlobal << std::endl;
190 unsigned int nNearByClusGlobal = 0;
191 countClusters(nearByClusterCollectionHandle, nNearByClusGlobal);
194 edm::LogInfo(
"NearbyPixelClustersAnalyzer") <<
"total close-by clusters: " << nNearByClusGlobal << std::endl;
202 if (!trajTrackCollectionHandle.isValid())
205 for (
const auto& pair : *trajTrackCollectionHandle) {
210 if (!measurement.updatedState().isValid())
224 if (!(trajStateOnSurface.
isValid()))
231 const auto& traj_lx = localPosition.
x();
232 const auto& traj_ly = localPosition.
y();
235 nearByClusterCollectionHandle, pixelCPE_, trackerGeometry_, r_rawId.
rawId(), traj_lx, traj_ly);
237 float dist = (loc.first != -999.) ?
std::sqrt(loc.first * loc.first + loc.second * loc.second) : -0.1;
241 <<
"RawID:" << r_rawId.
rawId() <<
" (valid hit), distance: " << dist << std::endl;
247 <<
"RawID:" << r_rawId.
rawId() <<
" (missing hit), distance: " << dist << std::endl;
253 <<
"RawID:" << r_rawId.
rawId() <<
" (inactive hit), distance: " << dist << std::endl;
264 "h_nALCARECOClusters",
"Number of Pixel clusters per event (ALCARECO) ;N_{clusters};events", 20, 0, 20);
266 "h_nCloseByClusters",
"Number of Pixel clusters per event (close-by) ;N_{clusters};events", 20, 0, 20);
270 "h_distClosestValid",
271 "Distance of Closest cluster to trajectory (valid);distance (cm); valid trajectory measurements",
276 "h_distClosestMissing",
277 "Distance of Closest cluster to trajectory (missing);distance (cm);missing trajectory measurements",
282 "h_distClosestInactive",
283 "Distance of Closest cluster to trajectory (inactive);distance (cm);inactive trajectory measurements",
290 "h_distClosestTrack",
291 "#DeltaR Distance of Closest track to the muon trajectory;#DeltaR distance; muon trajectories",
325 if (forwardPredictedState.isValid() && backwardPredictedState.isValid())
326 return trajStateCombiner(forwardPredictedState, backwardPredictedState);
328 else if (backwardPredictedState.isValid())
329 return backwardPredictedState;
331 else if (forwardPredictedState.isValid())
332 return forwardPredictedState;
334 edm::LogError(
"NearbyPixelClusterProducer") <<
"Error saving traj. measurement data."
335 <<
" Trajectory state on surface cannot be determined." << std::endl;
343 unsigned int& nClusGlobal)
346 for (
const auto& DSVItr : *
handle) {
347 uint32_t rawid(DSVItr.detId());
349 LogDebug(
"NearbyPixelClustersAnalyzer") <<
"DetId: " << detId.rawId() <<
" size: " << DSVItr.size() << std::endl;
350 nClusGlobal += DSVItr.size();
369 auto loc = std::make_pair(-999., -999.);
371 for (; itClusterSet != clusterCollection.
end(); itClusterSet++) {
372 DetId detId(itClusterSet->id());
373 if (detId.rawId() != rawId)
376 unsigned int subDetId = detId.subdetId();
379 <<
"ERROR: not a pixel cluster!!!" << std::endl;
385 for (; itCluster != itClusterSet->
end(); ++itCluster) {
386 LocalPoint lp(itCluster->x(), itCluster->y(), 0.);
390 float D =
sqrt((lp.
x() - traj_lx) * (lp.
x() - traj_lx) + (lp.
y() - traj_ly) * (lp.
y() - traj_ly));
393 loc.first = (lp.
x() - traj_lx);
394 loc.second = (lp.
y() - traj_ly);
405 for (; itClusterSet != clusterCollection.
end(); itClusterSet++) {
406 DetId detId(itClusterSet->id());
409 for (; itCluster != itClusterSet->end(); ++itCluster) {
410 const std::vector<SiPixelCluster::Pixel> pixelsVec = (*itCluster).pixels();
411 for (
unsigned int i = 0;
i < pixelsVec.size(); ++
i) {
412 float pixx = pixelsVec[
i].x;
413 float pixy = pixelsVec[
i].y;
414 float pixel_charge = pixelsVec[
i].adc;
415 histoMap_[detId.rawId()]->Fill(pixy, pixx, pixel_charge);
426 <<
"@SUB=NearbyPixelClustersAnalyzer::beginRun() before booking histoMap_.size(): " <<
histoMap_.size()
438 unsigned nPixelDets = 0;
439 for (
const auto& it : pDD_->
detUnits()) {
441 if (mit !=
nullptr) {
447 if (detIds.size() != nPixelDets) {
449 <<
"The size of the detId list specified from file (" << detIds.size()
450 <<
") differs from the one in TrackerGeometry (" << nPixelDets <<
")! Please cross-check" << std::endl;
453 for (
const auto& it : detIds) {
460 LogDebug(
"NearbyPixelClustersAnalyzer") <<
"booking " << thePart << std::endl;
470 <<
"@SUB=NearbyPixelClusterAnalyzer::beginRun() After booking histoMap_.size(): " <<
histoMap_.size()
479 int subdetId_(-999),
layer_(-999), side_(-999);
493 ret += (side_ == 1) ? Form(
"P_disk%i",
layer_) : Form(
"M_disk%i",
layer_);
496 edm::LogError(
"NearbyPixelClusterAnalyzer") <<
"we should never be here!" << std::endl;
500 return std::make_tuple(
ret, subdetId_,
layer_, side_);
507 std::map<uint32_t, TH2F*> hd;
510 for (
const auto& it : detIds) {
512 if (it == 0 || it == 0xFFFFFFFF) {
514 <<
"Wrong det id: " << it <<
" ... neglecting!" << std::endl;
531 Form(
"Cluster Map for module %s;n. cols;n. rows;pixel charge [ADC counts]",
moduleName.c_str()),
546 desc.setComment(
"Analysis of the closebyPixelClusters collections");
553 "SLHCUpgradeSimulations/Geometry/data/PhaseI/PixelSkimmedGeometry_phase1.txt");