|
|
#include <BetaCalculatorECAL.h>
|
void | addStepToXtal (std::map< int, GlobalPoint > &trackExitPositionMap, std::map< int, float > &trackCrossedXtalMap, DetId aDetId, float step, GlobalPoint point, const CaloSubdetectorGeometry *theSubdetGeometry) |
|
std::vector< SteppingHelixStateInfo > | calcEcalDeposit (const FreeTrajectoryState *tkInnerState, const DetIdAssociator &associator) |
|
int | getDetailedTrackLengthInXtals (std::map< int, GlobalPoint > &trackExitPositionMap, std::map< int, float > &trackCrossedXtalMap, double &totalLengthCurved, GlobalPoint &internalPointCurved, GlobalPoint &externalPointCurved, const CaloGeometry *theGeometry, const CaloTopology *theTopology, const std::vector< SteppingHelixStateInfo > &neckLace) |
|
Definition at line 31 of file BetaCalculatorECAL.h.
◆ BetaCalculatorECAL()
◆ addInfoToCandidate()
Definition at line 32 of file BetaCalculatorECAL.cc.
63 for (reco::TrackCollection::const_iterator ndTrack =
tracks->begin(); ndTrack !=
tracks->end(); ++ndTrack) {
65 sqrt(
pow((
track.outerEta() - ndTrack->outerEta()), 2) +
pow((
track.outerPhi() - ndTrack->outerPhi()), 2));
75 std::map<int, GlobalPoint> trackExitPositionMap;
76 std::map<int, float> trackCrossedXtalCurvedMap;
80 std::vector<SteppingHelixStateInfo> neckLace;
83 double totalLengthCurved = 0.;
86 if (neckLace.size() > 1) {
88 trackCrossedXtalCurvedMap,
98 float sumWeightedTime = 0;
99 float sumTimeErrorSqr = 0;
101 float sumTrackLength = 0;
102 std::vector<EcalRecHit> crossedRecHits;
105 std::map<int, GlobalPoint>::const_iterator trackExitMapIt = trackExitPositionMap.begin();
106 for (std::map<int, float>::const_iterator mapIt = trackCrossedXtalCurvedMap.begin();
107 mapIt != trackCrossedXtalCurvedMap.end();
111 thisHit = ebRecHits->
find(ebDetId);
112 if (thisHit == ebRecHits->
end()) {
118 if (!
hit.isTimeValid())
120 uint32_t rhFlag =
hit.recoFlag();
124 float errorOnThis =
hit.timeError();
125 sumTrackLength += mapIt->second;
126 sumEnergy +=
hit.energy();
127 crossedRecHits.push_back(
hit);
130 result.ecalTrackLengths.push_back(mapIt->second);
131 result.ecalTrackExitPositions.push_back(trackExitMapIt->second);
132 result.ecalEnergies.push_back(
hit.energy());
134 result.ecalTimeErrors.push_back(
hit.timeError());
135 result.ecalOutOfTimeEnergies.push_back(0.);
136 result.ecalOutOfTimeChi2s.push_back(0.);
138 result.ecalDetIds.push_back(ebDetId);
143 if (
hit.isTimeErrorValid())
145 sumWeightedTime +=
hit.time() / (errorOnThis * errorOnThis);
146 sumTimeErrorSqr += 1 / (errorOnThis * errorOnThis);
152 if (!crossedRecHits.empty()) {
154 sort(crossedRecHits.begin(), crossedRecHits.end(), [](
auto&
x,
auto&
y) {
return (
x.energy() >
y.energy()); });
155 result.ecalCrossedEnergy = sumEnergy;
156 result.ecalCrysCrossed = crossedRecHits.size();
157 result.ecalDeDx = sumEnergy / sumTrackLength;
162 if (sumTimeErrorSqr > 0) {
163 result.ecalTime = sumWeightedTime / sumTimeErrorSqr;
164 result.ecalTimeError =
sqrt(1 / sumTimeErrorSqr);
165 DetId maxEnergyId = crossedRecHits.begin()->id();
167 if (maxEnergyId !=
DetId())
173 double muonShowerMax = frontFaceR + 11.5;
174 double gammaShowerMax = frontFaceR + 6.23;
189 if (!
info.crossedHcalRecHits.empty()) {
References TrackDetectorAssociator::associate(), bField_, bFieldToken_, calcEcalDeposit(), caloTopologyToken_, flavorHistoryFilter_cfi::dr, EBRecHitCollectionToken_, EcalBarrel, ecalDetIdAssociatorToken_, TrackDetMatchInfo::EcalRecHits, EERecHitCollectionToken_, edm::SortedCollection< T, SORT >::end(), edm::SortedCollection< T, SORT >::find(), edm::EventSetup::getData(), getDetailedTrackLengthInXtals(), TrackDetectorAssociator::getFreeTrajectoryState(), susybsm::HSCParticle::hasTrackRef(), TrackDetMatchInfo::HcalRecHits, TrackDetMatchInfo::HORecHits, iEvent, info(), trajectoryStateTransform::innerFreeState(), EcalRecHit::kGood, EcalRecHit::kOutOfTime, EcalRecHit::kPoorCalib, parameters_, position, funct::pow(), mps_fire::result, fastsim::Constants::speedOfLight, mathSSE::sqrt(), DetId::subdetId(), theCaloGeometryToken_, HLT_FULL_cff::track, trackAssociator_, susybsm::HSCParticle::trackRef(), PDWG_EXOHSCP_cff::tracks, x, and y.
◆ addStepToXtal()
Definition at line 315 of file BetaCalculatorECAL.cc.
321 auto cell_p = theSubdetGeometry->
getGeometry(aDetId);
325 std::map<int, GlobalPoint>::iterator xtal = trackExitPositionMap.find(aDetId.
rawId());
326 if (xtal != trackExitPositionMap.end())
327 ((*xtal).second) =
diff;
329 trackExitPositionMap.insert(std::pair<int, GlobalPoint>(aDetId.
rawId(),
diff));
331 std::map<int, float>::iterator xtal2 = trackCrossedXtalMap.find(aDetId.
rawId());
332 if (xtal2 != trackCrossedXtalMap.end())
333 ((*xtal2).second) +=
step;
335 trackCrossedXtalMap.insert(std::pair<int, float>(aDetId.
rawId(),
step));
References change_name::diff, CaloSubdetectorGeometry::getGeometry(), AlCaHLTBitMon_ParallelJobs::p, point, and DetId::rawId().
Referenced by getDetailedTrackLengthInXtals().
◆ calcEcalDeposit()
◆ getDetailedTrackLengthInXtals()
Definition at line 221 of file BetaCalculatorECAL.cc.
230 internalPointCurved = origin;
231 externalPointCurved = origin;
233 bool firstPoint =
false;
234 trackCrossedXtalMap.clear();
239 for (std::vector<SteppingHelixStateInfo>::const_iterator
itr = (neckLace.begin() + 1);
itr != neckLace.end(); ++
itr) {
241 std::vector<DetId> surroundingMatrix;
249 ->inside(probe_gp))) {
250 double step = ((*itr).position() - (*(
itr - 1)).position()).
mag();
253 trackExitPositionMap, trackCrossedXtalMap, closestEndcapDetIdToProbe,
step,
point, theEndcapSubdetGeometry);
254 totalLengthCurved +=
step;
256 if (firstPoint ==
false) {
257 internalPointCurved = probe_gp;
261 externalPointCurved = probe_gp;
266 ->inside(probe_gp))) {
267 double step = ((*itr).position() - (*(
itr - 1)).position()).
mag();
270 trackExitPositionMap, trackCrossedXtalMap, closestBarrelDetIdToProbe,
step,
point, theBarrelSubdetGeometry);
271 totalLengthCurved +=
step;
273 if (firstPoint ==
false) {
274 internalPointCurved = probe_gp;
278 externalPointCurved = probe_gp;
284 for (
unsigned int k = 0;
k < surroundingMatrix.size(); ++
k) {
287 ->inside(probe_gp)) {
288 double step = ((*itr).position() - (*(
itr - 1)).position()).
mag();
292 surroundingMatrix[
k],
296 totalLengthCurved +=
step;
298 if (firstPoint ==
false) {
299 internalPointCurved = probe_gp;
303 externalPointCurved = probe_gp;
308 surroundingMatrix.clear();
References addStepToXtal(), DetId::Ecal, CaloSubdetectorGeometry::getClosestCell(), CaloSubdetectorGeometry::getGeometry(), ecaldqm::getGeometry(), CaloGeometry::getSubdetectorGeometry(), CaloTopology::getSubdetectorTopology(), CaloSubdetectorTopology::getWindow(), dqmdumpme::k, mag(), and point.
Referenced by addInfoToCandidate().
◆ bField_
◆ bFieldToken_
◆ caloTopologyToken_
◆ EBRecHitCollectionToken_
◆ ecalDetIdAssociatorToken_
◆ EERecHitCollectionToken_
◆ parameters_
◆ theCaloGeometryToken_
◆ trackAssociator_
static constexpr double speedOfLight
Speed of light [cm / ns].
std::vector< EcalRecHit >::const_iterator const_iterator
void useDefaultPropagator()
use the default propagator
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
TrackAssociatorParameters parameters_
edm::ESGetToken< CaloGeometry, CaloGeometryRecord > theCaloGeometryToken_
edm::ESGetToken< DetIdAssociator, DetIdAssociatorRecord > ecalDetIdAssociatorToken_
edm::EDGetTokenT< EBRecHitCollection > EBRecHitCollectionToken_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const CaloGeometry * getGeometry()
void loadParameters(const edm::ParameterSet &, edm::ConsumesCollector &)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
edm::EDGetTokenT< EERecHitCollection > EERecHitCollectionToken_
int getDetailedTrackLengthInXtals(std::map< int, GlobalPoint > &trackExitPositionMap, std::map< int, float > &trackCrossedXtalMap, double &totalLengthCurved, GlobalPoint &internalPointCurved, GlobalPoint &externalPointCurved, const CaloGeometry *theGeometry, const CaloTopology *theTopology, const std::vector< SteppingHelixStateInfo > &neckLace)
static FreeTrajectoryState getFreeTrajectoryState(const MagneticField *, const reco::Track &)
get FreeTrajectoryState from different track representations
const_iterator end() const
const CaloSubdetectorTopology * getSubdetectorTopology(const DetId &id) const
access the subdetector Topology for the given subdetector directly
static int position[264][3]
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > bFieldToken_
edm::ESGetToken< CaloTopology, CaloTopologyRecord > caloTopologyToken_
const MagneticField * bField_
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
virtual DetId getClosestCell(const GlobalPoint &r) const
std::vector< SteppingHelixStateInfo > propagateThoughFromIP(const SteppingHelixStateInfo &state, const Propagator *prop, const FiducialVolume &volume, int nsteps, float step, float minR, float minZ, float maxR, float maxZ)
std::vector< std::pair< float, float > >::iterator itr
void addStepToXtal(std::map< int, GlobalPoint > &trackExitPositionMap, std::map< int, float > &trackCrossedXtalMap, DetId aDetId, float step, GlobalPoint point, const CaloSubdetectorGeometry *theSubdetGeometry)
bool getData(T &iHolder) const
virtual std::vector< DetId > getWindow(const DetId &id, const int &northSouthSize, const int &eastWestSize) const
T mag() const
The vector magnitude. Equivalent to sqrt(vec.mag2())
iterator find(key_type k)
constexpr uint32_t rawId() const
get the raw id
reco::TrackRef trackRef() const
T getParameter(std::string const &) const
TrackDetectorAssociator trackAssociator_
Power< A, B >::type pow(const A &a, const B &b)
TrackDetMatchInfo associate(const edm::Event &, const edm::EventSetup &, const FreeTrajectoryState &, const AssociatorParameters &)
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
std::vector< SteppingHelixStateInfo > calcEcalDeposit(const FreeTrajectoryState *tkInnerState, const DetIdAssociator &associator)