48 const std::set<unsigned> RelevantProcesses = {0};
58 void endJob()
override;
70 const vector<TH2F*>&
histo)
const;
77 const vector<TH2F*>& histo)
const;
82 pair<unsigned int, float>&
key,
83 unsigned int&
ss)
const;
109 using Lock = std::unique_lock<std::mutex>;
121 for (
int subdet = 0; subdet <= 1; subdet++) {
122 for (
int ex = 0; ex <=
exMax; ex++)
123 for (
int ey = 0; ey <=
eyMax; ey++) {
124 sprintf(histName,
"hspc_%d_%d_%d", subdet, ex, ey);
125 hspc.push_back(
new TH2F(histName,
127 10 * 2 * (
exMax + 2),
130 10 * 2 * (
eyMax + 2),
134 sprintf(histName,
"hrpc_%d_%d_%d", subdet, ex, ey);
135 hrpc.push_back(
new TH2F(histName,
137 10 * 2 * (
exMax + 2),
140 10 * 2 * (
eyMax + 2),
145 theMutex = std::make_unique<std::mutex[]>(hspc.size());
152 hasSimHits(pset.getParameter<bool>(
"hasSimHits")),
153 hasRecTracks(pset.getParameter<bool>(
"hasRecTracks")),
154 noBPIX1(pset.getParameter<bool>(
"noBPIX1")),
158 clusterShapeCache_token(
160 trackerHitAssociatorConfig_(pset, consumesCollector()) {
161 file =
new TFile(
"clusterShape.root",
"RECREATE");
190 bool isOutgoing =
std::abs(ldir.
z()) > 0.01
f && (lvec.
z() * ldir.
z() > 0);
193 const bool isRelevant = RelevantProcesses.count(simHit.
processType());
198 constexpr
float ptCut2 = 0.2 * 0.2;
203 return (isOutgoing && isRelevant && isFast);
211 const vector<TH2F*>&
histo)
const {
214 pair<float, float> pred;
216 if (theClusterShape.
getSizes(recHit, ldir, clusterShapeCache, part, meas, pred))
217 if (meas.
size() == 1)
224 std::cout <<
id <<
" bigpred " << meas.
front().first <<
'/' << meas.
front().second <<
' ' << pred.first <<
'/'
225 << pred.second <<
' ' << ldir <<
' ' << ldir.
mag() << std::endl;
229 histo[
i]->Fill(pred.first, pred.second);
238 const vector<TH2F*>&
histo)
const {
240 processRec(recHit, theClusterFilter, ldir, clusterShapeCache, histo);
247 pair<unsigned int, float>&
key,
248 unsigned int&
ss)
const {
252 for (
auto const& sh :
simHits) {
275 std::map<pair<unsigned int, float>, Elem> simHitMap;
278 pair<unsigned int, float>
key;
281 for (
auto const& recHit : recHits) {
284 if (!
checkSimHits(recHit, theHitAssociator, simHit, key, ss))
287 if (simHitMap.count(key) == 0) {
288 simHitMap[
key] = {&recHit, simHit, ss};
289 }
else if (recHit.cluster()->size() > simHitMap[
key].rhit->cluster()->size())
290 simHitMap[key] = {&recHit, simHit,
std::max(ss, simHitMap[key].
size)};
292 for (
auto const& elem : simHitMap) {
302 if (elem.second.size == 1)
303 processSim(*elem.second.rhit, theFilter, elem.second.shit, clusterShapeCache,
hspc);
343 for (
auto const&
track : *tracks) {
346 if (
track.numberOfValidHits() < 8)
348 auto const& trajParams =
track.extra()->trajParams();
350 auto hb =
track.recHitsBegin();
351 for (
unsigned int h = 0;
h <
track.recHitsSize();
h++) {
352 auto recHit = *(hb +
h);
353 if (!recHit->isValid())
355 auto id = recHit->geographicalId();
356 if (
noBPIX1 && tkTpl.pxbLayer(
id) == 1)
360 auto subdetid = (
id.subdetId());
363 auto const& ltp = trajParams[
h];
364 auto ldir = ltp.momentum() / ltp.momentum().mag();
370 if (pixelRecHit !=
nullptr)
371 processRec(*pixelRecHit, theClusterShape, ldir, *clusterShapeCache,
hrpc);
380 LogTrace(
"MinBiasTracking") <<
" [ClusterShape] analyze simHits, recHits";
385 LogTrace(
"MinBiasTracking") <<
" [ClusterShape] analyze recHits on recTracks";
std::vector< data_type > DataContainer
LocalVector momentumAtEntry() const
The momentum of the track that produced the hit, at entry point.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
Global3DPoint GlobalPoint
std::vector< Track > TrackCollection
collection of Tracks
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
auto const & tracks
cannot be loose
example_stream void analyze(const edm::Event &, const edm::EventSetup &) override
bool getData(T &iHolder) const
Local3DPoint exitPoint() const
Exit point in the local Det frame.
const Surface::PositionType & position() const
The position (origin of the R.F.)
float timeOfFlight() const
tuple key
prepare the HTCondor submission files and eventually submit them
Abs< T >::type abs(const T &t)
bool isFast(TrackingRecHit const &hit)
unsigned int pxbLayer(const DetId &id) const
T const * product() const
unsigned short processType() const
bool getSizes(const SiPixelRecHit &recHit, const LocalVector &ldir, const SiPixelClusterShapeCache &clusterShapeCache, int &part, ClusterData::ArrayType &meas, std::pair< float, float > &predr, PixelData const *pd=nullptr) const
virtual const GeomDetUnit * detUnit() const
bool isPixel(HitType hitType)
unsigned int trackId() const
std::vector< PSimHit > associateHit(const TrackingRecHit &thit) const
DetId geographicalId() const
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
constexpr size_type size() const noexcept
Local3DPoint entryPoint() const
Entry point in the local Det frame.
tuple size
Write out results.