138 _multiplicityMapTokens(),
151 std::vector<edm::ParameterSet> seedCollectionConfigs =
152 iConfig.getParameter<std::vector<edm::ParameterSet>>(
"seedCollections");
154 for (std::vector<edm::ParameterSet>::const_iterator scps = seedCollectionConfigs.begin();
155 scps != seedCollectionConfigs.end();
157 _seedcollTokens.push_back(consumes<TrajectorySeedCollection>(scps->getParameter<
edm::InputTag>(
"src")));
158 _seedbins.push_back(scps->getUntrackedParameter<
unsigned int>(
"nBins", 1000));
159 _seedmax.push_back(scps->getUntrackedParameter<
double>(
"maxValue", 100000.));
161 if (scps->exists(
"trackFilter")) {
162 _seedfilters.push_back(
163 FromTrackRefSeedFilter(consumesCollector(), scps->getParameter<
edm::ParameterSet>(
"trackFilter")));
165 _seedfilters.push_back(FromTrackRefSeedFilter());
169 std::vector<edm::ParameterSet> correlationConfigs =
170 iConfig.getParameter<std::vector<edm::ParameterSet>>(
"multiplicityCorrelations");
172 for (std::vector<edm::ParameterSet>::const_iterator ps = correlationConfigs.begin(); ps != correlationConfigs.end();
174 _multiplicityMapTokens.push_back(
175 consumes<std::map<unsigned int, int>>(ps->getParameter<
edm::InputTag>(
"multiplicityMap")));
176 _labels.push_back(ps->getParameter<
std::string>(
"detLabel"));
177 _selections.push_back(ps->getParameter<
unsigned int>(
"detSelection"));
178 _binsmult.push_back(ps->getParameter<
unsigned int>(
"nBins"));
179 _binseta.push_back(ps->getParameter<
unsigned int>(
"nBinsEta"));
180 _maxs.push_back(ps->getParameter<
double>(
"maxValue"));
185 std::vector<unsigned int>::const_iterator nseedbins = _seedbins.begin();
186 std::vector<double>::const_iterator seedmax = _seedmax.begin();
187 std::vector<FromTrackRefSeedFilter>::const_iterator
filter = _seedfilters.begin();
189 for (std::vector<edm::ParameterSet>::const_iterator scps = seedCollectionConfigs.begin();
190 scps != seedCollectionConfigs.end();
191 ++scps, ++nseedbins, ++seedmax, ++
filter) {
196 _hseedmult.push_back(tfserv->
make<TH1F>(
197 hname.c_str(), htitle.c_str(), *nseedbins + 1, 0.5 - *seedmax / (*nseedbins), *seedmax + 0.5));
198 _hseedmult[_hseedmult.size() - 1]->GetXaxis()->SetTitle(
"seeds");
199 _hseedmult[_hseedmult.size() - 1]->GetYaxis()->SetTitle(
"events");
202 htitle = extendedlabel +
std::string(
" seed pseudorapidity");
203 _hseedeta.push_back(tfserv->
make<TH1F>(hname.c_str(), htitle.c_str(), 80, -4., 4.));
204 _hseedeta[_hseedeta.size() - 1]->GetXaxis()->SetTitle(
"#eta");
205 _hseedeta[_hseedeta.size() - 1]->GetYaxis()->SetTitle(
"seeds");
208 htitle = extendedlabel +
std::string(
" seed phi vs pseudorapidity");
209 _hseedphieta.push_back(tfserv->
make<TH2F>(hname.c_str(), htitle.c_str(), 80, -4., 4., 80, -
M_PI,
M_PI));
210 _hseedphieta[_hseedphieta.size() - 1]->GetXaxis()->SetTitle(
"#eta");
211 _hseedphieta[_hseedphieta.size() - 1]->GetYaxis()->SetTitle(
"#phi");
213 _hseedmult2D.push_back(std::vector<TH2F*>());
214 _hseedeta2D.push_back(std::vector<TH2F*>());
217 htitle = extendedlabel +
std::string(
" seed SiPixelRecHit multiplicity");
218 _hpixelrhmult.push_back(tfserv->
make<TH1F>(hname.c_str(), htitle.c_str(), 5, -.5, 4.5));
219 _hpixelrhmult[_hpixelrhmult.size() - 1]->GetXaxis()->SetTitle(
"NRecHits");
220 _hpixelrhmult[_hpixelrhmult.size() - 1]->GetYaxis()->SetTitle(
"seeds");
222 hname = extendedlabel +
std::string(
"_bpixleneta");
223 htitle = extendedlabel +
std::string(
" seed BPIX cluster length vs pseudorapidity");
224 _hbpixclusleneta.push_back(tfserv->
make<TH2F>(hname.c_str(), htitle.c_str(), 80, -4., 4., 40, -0.5, 39.5));
225 _hbpixclusleneta[_hbpixclusleneta.size() - 1]->GetXaxis()->SetTitle(
"#eta");
226 _hbpixclusleneta[_hbpixclusleneta.size() - 1]->GetYaxis()->SetTitle(
"length");
228 hname = extendedlabel +
std::string(
"_fpixleneta");
229 htitle = extendedlabel +
std::string(
" seed FPIX cluster length vs pseudorapidity");
230 _hfpixclusleneta.push_back(tfserv->
make<TH2F>(hname.c_str(), htitle.c_str(), 80, -4., 4., 40, -0.5, 39.5));
231 _hfpixclusleneta[_hfpixclusleneta.size() - 1]->GetXaxis()->SetTitle(
"#eta");
232 _hfpixclusleneta[_hfpixclusleneta.size() - 1]->GetYaxis()->SetTitle(
"length");
234 hname = extendedlabel +
std::string(
"_bpixlenangle");
235 htitle = extendedlabel +
std::string(
" seed BPIX cluster length vs track projection");
236 _hbpixcluslenangle.push_back(tfserv->
make<TH2F>(hname.c_str(), htitle.c_str(), 200, -1., 1., 40, -0.5, 39.5));
237 _hbpixcluslenangle[_hbpixcluslenangle.size() - 1]->GetXaxis()->SetTitle(
"projection");
238 _hbpixcluslenangle[_hbpixcluslenangle.size() - 1]->GetYaxis()->SetTitle(
"length");
240 hname = extendedlabel +
std::string(
"_fpixlenangle");
241 htitle = extendedlabel +
std::string(
" seed FPIX cluster length vs track projection");
242 _hfpixcluslenangle.push_back(tfserv->
make<TH2F>(hname.c_str(), htitle.c_str(), 200, -1., 1., 40, -0.5, 39.5));
243 _hfpixcluslenangle[_hfpixcluslenangle.size() - 1]->GetXaxis()->SetTitle(
"projection");
244 _hfpixcluslenangle[_hfpixcluslenangle.size() - 1]->GetYaxis()->SetTitle(
"length");
246 for (
unsigned int i = 0;
i < _multiplicityMapTokens.size(); ++
i) {
249 std::string htitle2D = extendedlabel +
" seeds multiplicity";
251 htitle2D += _labels[
i];
253 _hseedmult2D[_hseedmult2D.size() - 1].push_back(tfserv->
make<TH2F>(hname2D.c_str(),
259 0.5 - *seedmax / (*nseedbins),
261 _hseedmult2D[_hseedmult2D.size() - 1][_hseedmult2D[_hseedmult2D.size() - 1].size() - 1]->GetXaxis()->SetTitle(
263 _hseedmult2D[_hseedmult2D.size() - 1][_hseedmult2D[_hseedmult2D.size() - 1].size() - 1]->GetYaxis()->SetTitle(
266 hname2D = extendedlabel + _labels[
i];
268 htitle2D = extendedlabel +
" seeds pseudorapidity";
270 htitle2D += _labels[
i];
272 _hseedeta2D[_hseedeta2D.size() - 1].push_back(
273 tfserv->
make<TH2F>(hname2D.c_str(), htitle2D.c_str(), _binseta[
i], 0., _maxs[
i], 80, -4., 4.));
274 _hseedeta2D[_hseedeta2D.size() - 1][_hseedeta2D[_hseedeta2D.size() - 1].size() - 1]->GetXaxis()->SetTitle(
"hits");
275 _hseedeta2D[_hseedeta2D.size() - 1][_hseedeta2D[_hseedeta2D.size() - 1].size() - 1]->GetYaxis()->SetTitle(
"#eta");
302 std::map<unsigned int, int>::const_iterator
mult = mults->find(
_selections[
i]);
304 if (
mult != mults->end()) {
305 tmpmult[
i] =
mult->second;
322 std::vector<TH1F*>::iterator histomult =
_hseedmult.begin();
323 std::vector<std::vector<TH2F*>>::iterator histomult2D =
_hseedmult2D.begin();
324 std::vector<TH1F*>::iterator histoeta =
_hseedeta.begin();
325 std::vector<TH2F*>::iterator histophieta =
_hseedphieta.begin();
326 std::vector<std::vector<TH2F*>>::iterator histoeta2D =
_hseedeta2D.begin();
327 std::vector<TH1F*>::iterator hpixelrhmult =
_hpixelrhmult.begin();
369 unsigned int nseeds = 0;
370 unsigned int iseed = 0;
380 double eta =
state.globalMomentum().eta();
381 double phi =
state.globalMomentum().phi();
383 (*histoeta)->Fill(
eta);
384 (*histophieta)->Fill(
eta,
phi);
388 (*histoeta2D)[
i]->Fill(tmpmult[
i],
eta);
392 for (
auto const&
hit :
seed->recHits()) {
403 (*histobpixleneta)->Fill(
eta, sphit->
cluster()->sizeY());
408 (*histobpixlenangle)->Fill(normdx, sphit->
cluster()->sizeY());
412 (*histofpixleneta)->Fill(
eta, sphit->
cluster()->sizeX());
417 (*histofpixlenangle)->Fill(normdy, sphit->
cluster()->sizeX());
425 (*hpixelrhmult)->Fill(npixelrh);
428 (*histomult)->Fill(nseeds);
432 (*histomult2D)[
i]->Fill(tmpmult[
i], nseeds);
438 : m_suffix(
""), m_passthrough(
true), m_trackcollToken(), m_seltrackrefcollToken(), m_tracks(), m_seltrackrefs() {}
442 : m_suffix(iConfig.getParameter<
std::
string>(
"suffix")),
443 m_passthrough(
false),
445 m_seltrackrefcollToken(
453 if (!m_passthrough) {
454 iEvent.getByToken(m_trackcollToken, m_tracks);
455 iEvent.getByToken(m_seltrackrefcollToken, m_seltrackrefs);
471 if (trkref == *seltrkref)
ClusterRef cluster() const
static const std::string kSharedResource
SeedMultiplicityAnalyzer(const edm::ParameterSet &)
T getParameter(std::string const &) const
const std::string & suffix() const
std::vector< FromTrackRefSeedFilter > _seedfilters
std::vector< unsigned int > _binseta
void prepareEvent(const edm::Event &iEvent)
#define DEFINE_FWK_MODULE(type)
std::vector< unsigned int > _selections
~SeedMultiplicityAnalyzer() override
std::vector< double > _maxs
std::vector< std::string > _labels
std::vector< Track > TrackCollection
collection of Tracks
std::vector< TH2F * > _hfpixcluslenangle
std::vector< std::vector< TH2F * > > _hseedeta2D
std::vector< TH2F * > _hfpixclusleneta
void analyze(const edm::Event &, const edm::EventSetup &) override
std::vector< unsigned int > _binsmult
Log< level::Error, false > LogError
edm::RefVector< TrackCollection > TrackRefVector
vector of reference to Track in the same collection
constexpr Detector det() const
get the detector field from this detid
std::vector< edm::EDGetTokenT< std::map< unsigned int, int > > > _multiplicityMapTokens
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
std::vector< edm::EDGetTokenT< TrajectorySeedCollection > > _seedcollTokens
std::vector< unsigned int > _seedbins
edm::EDGetTokenT< reco::TrackRefVector > m_seltrackrefcollToken
edm::EDGetTokenT< reco::TrackCollection > m_trackcollToken
LocalVector localMomentum() const
std::vector< TH1F * > _hseedeta
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
bool getData(T &iHolder) const
std::shared_ptr< TrackingRecHit const > RecHitPointer
std::vector< TH1F * > _hseedmult
std::vector< TH2F * > _hseedphieta
std::vector< TH1F * > _hpixelrhmult
DetId geographicalId() const
std::vector< TH2F * > _hbpixcluslenangle
constexpr uint32_t rawId() const
get the raw id
std::vector< std::vector< TH2F * > > _hseedmult2D
T * make(const Args &...args) const
make new ROOT object
bool isSelected(const unsigned int iseed) const
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > _magFieldToken
Log< level::Warning, false > LogWarning
std::vector< double > _seedmax
edm::Handle< reco::TrackCollection > m_tracks
std::vector< TH2F * > _hbpixclusleneta
edm::Handle< reco::TrackRefVector > m_seltrackrefs
edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > _TTRHBuilderToken