133 usesResource(
"TFileService");
136 tree_ =
fs->make<TTree>(
"CPEanalysis",
"CPE analysis tree");
138 "Overlaps", &
treeBranches_,
"x:y:z:distance:mdistance:shift:offsetA:offsetB:angle:x1r:x2r:x1m:x2m:y1m:y2m");
142 tree_->Branch(
"Geom1", &
geom1Branches_,
"subdet/I:moduleGeometry/I:stereo/I:layer/I:side/I:ring/I:pitch/F:detid/I");
143 tree_->Branch(
"Geom2", &
geom2Branches_,
"subdet/I:moduleGeometry/I:stereo/I:layer/I:side/I:ring/I:pitch/F:detid/I");
159 std::vector<SiStripOverlapHit> hitpairs;
165 for (
const auto&
tt : *trajTrackAssociations) {
166 auto& traj = *(
tt.key);
177 for (
auto it = traj.measurements().begin(); it != traj.measurements().end(); ++it) {
185 auto layerRangeEnd = it + 1;
186 for (; layerRangeEnd < traj.measurements().end(); ++layerRangeEnd) {
187 if (layerRangeEnd->layer()->seqNum() != meas.layer()->seqNum())
193 return goodMeasurement(
m) && (
m.recHit()->rawId() & 0x3) == (meas.recHit()->rawId() & 0x3);
197 if (meas2it != layerRangeEnd) {
198 auto& meas2 = *meas2it;
209 for (
const auto& pair : hitpairs) {
223 treeBranches_.
x1m = pair.trajectoryStateOnSurface(0,
false).localPosition().x();
224 treeBranches_.
y1m = pair.trajectoryStateOnSurface(0,
false).localPosition().y();
226 treeBranches_.
x2m = pair.trajectoryStateOnSurface(1,
false).localPosition().x();
227 treeBranches_.
y2m = pair.trajectoryStateOnSurface(1,
false).localPosition().y();
230 auto detset1 = (*clusters)[pair.hitA()->rawId()];
231 auto detset2 = (*clusters)[pair.hitB()->rawId()];
235 du =
tracker->idToDetUnit(pair.hitA()->rawId());
236 auto cluster1 = std::min_element(
241 du =
tracker->idToDetUnit(pair.hitB()->rawId());
242 auto cluster2 = std::min_element(
249 auto amplitudes1 = cluster1->amplitudes();
250 auto amplitudes2 = cluster2->amplitudes();
251 auto max1 = std::max_element(amplitudes1.begin(), amplitudes1.end());
252 auto max2 = std::max_element(amplitudes2.begin(), amplitudes2.end());
253 for (
unsigned int i = 0;
i < 11; ++
i) {
265 int offset = 5 - (max1 - amplitudes1.begin());
266 for (
auto&
s : amplitudes1) {
273 offset = 5 - (max2 - amplitudes2.begin());
274 for (
auto&
s : amplitudes2) {
282 DetId detid1 = pair.hitA()->geographicalId();
283 DetId detid2 = pair.hitB()->geographicalId();
336 return m.recHit()->isValid() &&
337 m.recHit()->geographicalId().subdetId() > 2 &&
338 (
m.recHit()->rawId() & 0x3) != 0 &&
339 m.recHit()->getType() == 0;
static constexpr auto TEC
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > topoToken_
virtual void localParameters(AClusters const &clusters, ALocalValues &retValues, const GeomDetUnit &gd, const LocalTrajectoryParameters <p) const
ClusterBranch cluster2Branches_
std::vector< Track > TrackCollection
collection of Tracks
SiStripCPEAnalyzer(const edm::ParameterSet &)
void analyze(const edm::Event &, const edm::EventSetup &) override
bool isStereo(const DetId &id) const
const edm::EDGetTokenT< TrajectoryCollection > trajsToken_
unsigned int side(const DetId &id) const
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > geomToken_
unsigned int tecRing(const DetId &id) const
ring id
unsigned int layer(const DetId &id) const
virtual float localPitch(const LocalPoint &) const =0
const edm::ESGetToken< StripClusterParameterEstimator, TkStripCPERecord > cpeToken_
~SiStripCPEAnalyzer() override=default
virtual const StripTopology & specificTopology() const
Returns a reference to the strip proxy topology.
static bool goodMeasurement(TrajectoryMeasurement const &m)
#define DEFINE_FWK_MODULE(type)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const edm::EDGetTokenT< TrajTrackAssociationCollection > tjTagToken_
const edm::EDGetTokenT< edmNew::DetSetVector< SiStripCluster > > clusToken_
constexpr uint32_t rawId() const
get the raw id
GeometryBranch geom2Branches_
const edm::ESInputTag cpeTag_
GeometryBranch geom1Branches_
std::vector< Trajectory > TrajectoryCollection
unsigned int tidRing(const DetId &id) const
const edm::EDGetTokenT< TrackCollection > tracksToken_
TrackBranch trackBranches_
static constexpr auto TID
const StripClusterParameterEstimator * parameterestimator_
ClusterBranch cluster1Branches_