78 const char*
varcrit[3] = {
"All",
"steps",
"n-1"};
123 float pileup,
trkdr,
trkdz,
trkvx,
trkvy,
trkvz,
trkmm,
trkth,
trkph,
chisq,
therr,
pherr,
hodx,
hody,
hoang,
htime,
151 : m_cosmic(iConfig.getUntrackedParameter<
bool>(
"cosmic",
true)),
152 m_zeroField(iConfig.getUntrackedParameter<
bool>(
"zeroField",
false)),
153 m_bins(iConfig.getUntrackedParameter<
int>(
"HOSignalBins", 120)),
154 m_low(iConfig.getUntrackedParameter<double>(
"lowerRange", -1.0)),
155 m_ahigh(iConfig.getUntrackedParameter<double>(
"upperRange", 29.0)),
156 m_histFill(iConfig.getUntrackedParameter<
bool>(
"histFill",
true)),
157 m_treeFill(iConfig.getUntrackedParameter<
bool>(
"treeFill",
false)),
158 m_verbose(iConfig.getUntrackedParameter<
bool>(
"verbose",
false)),
168 for (
int ij = 0; ij < 10; ij++) {
174 T1 =
fs->make<TTree>(
"T1",
"HOSignal");
176 T1->Branch(
"irun", &
irun,
"irun/I");
177 T1->Branch(
"ievt", &
ievt,
"ievt/i");
179 T1->Branch(
"isect", &
isect,
"isect/I");
180 T1->Branch(
"isect2", &
isect2,
"isect2/I");
181 T1->Branch(
"ndof", &
ndof,
"ndof/I");
182 T1->Branch(
"nmuon", &
nmuon,
"nmuon/I");
184 T1->Branch(
"ilumi", &
ilumi,
"ilumi/I");
186 T1->Branch(
"pileup", &
pileup,
"pileup/F");
187 T1->Branch(
"nprim", &
nprim,
"nprim/I");
188 T1->Branch(
"tkpt03", &
tkpt03,
" tkpt03/F");
189 T1->Branch(
"ecal03", &
ecal03,
" ecal03/F");
190 T1->Branch(
"hcal03", &
hcal03,
" hcal03/F");
193 T1->Branch(
"trkdr", &
trkdr,
"trkdr/F");
194 T1->Branch(
"trkdz", &
trkdz,
"trkdz/F");
196 T1->Branch(
"trkvx", &
trkvx,
"trkvx/F");
197 T1->Branch(
"trkvy", &
trkvy,
"trkvy/F");
198 T1->Branch(
"trkvz", &
trkvz,
"trkvz/F");
199 T1->Branch(
"trkmm", &
trkmm,
"trkmm/F");
200 T1->Branch(
"trkth", &
trkth,
"trkth/F");
201 T1->Branch(
"trkph", &
trkph,
"trkph/F");
203 T1->Branch(
"chisq", &
chisq,
"chisq/F");
204 T1->Branch(
"therr", &
therr,
"therr/F");
205 T1->Branch(
"pherr", &
pherr,
"pherr/F");
206 T1->Branch(
"hodx", &
hodx,
"hodx/F");
207 T1->Branch(
"hody", &
hody,
"hody/F");
208 T1->Branch(
"hoang", &
hoang,
"hoang/F");
210 T1->Branch(
"momatho", &
momatho,
"momatho/F");
211 T1->Branch(
"hoflag", &
hoflag,
"hoflag/i");
212 T1->Branch(
"htime", &
htime,
"htime/F");
213 T1->Branch(
"hosig",
hosig,
"hosig[9]/F");
214 T1->Branch(
"hocro", &
hocro,
"hocro/F");
215 T1->Branch(
"hocorsig",
hocorsig,
"hocorsig[18]/F");
216 T1->Branch(
"caloen",
caloen,
"caloen[3]/F");
222 for (
int ij = 0; ij <
netamx; ij++) {
224 for (
int jk = 0; jk <
nphimx; jk++) {
225 sprintf(
name,
"ho_indenergy_%i_%i", ij, jk);
226 sprintf(
title,
"ho IndEnergy (GeV) i#eta=%i i#phi=%i",
ieta, jk + 1);
232 muonnm =
fs->make<TH1F>(
"muonnm",
"No of muon", 10, -0.5, 9.5);
233 muonmm =
fs->make<TH1F>(
"muonmm",
"P_{mu}", 200, -100., 100.);
234 muonth =
fs->make<TH1F>(
"muonth",
"{Theta}_{mu}", 180, 0., 180.);
235 muonph =
fs->make<TH1F>(
"muonph",
"{Phi}_{mu}", 180, -180., 180.);
236 muonch =
fs->make<TH1F>(
"muonch",
"{chi^2}/ndf", 100, 0., 1000.);
238 sel_muonnm =
fs->make<TH1F>(
"sel_muonnm",
"No of muon(sel)", 10, -0.5, 9.5);
239 sel_muonmm =
fs->make<TH1F>(
"sel_muonmm",
"P_{mu}(sel)", 200, -100., 100.);
240 sel_muonth =
fs->make<TH1F>(
"sel_muonth",
"{Theta}_{mu}(sel)", 180, 0., 180.);
241 sel_muonph =
fs->make<TH1F>(
"sel_muonph",
"{Phi}_{mu}(sel)", 180, -180., 180.);
242 sel_muonch =
fs->make<TH1F>(
"sel_muonch",
"{chi^2}/ndf(sel)", 100, 0., 1000.);
245 const char* varnam[
ncut] = {
"ndof",
259 int nbinxx[
ncut] = {25, 60, 60, 60, 60, 60, 60, 120, 6, 60, 60, 120, 120, 60};
260 double alowxx[
ncut] = {5.5, 0., 0., -
angle_units::piRadians, 0.0, 0.0, 0.0, 0., 0.5, 0.0, 0.0, -20., -32., -45.0};
261 double ahghxx[
ncut] = {
262 30.5, 40.,
angle_units::piRadians,
angle_units::piRadians, 0.8, 0.02, 0.5, 300., 6.5, 10.0, 24.0, 20.0, 32.0, 45.0};
264 for (
int kl = 0; kl <
ncut; kl++) {
265 for (
int jk = 0; jk < 3; jk++) {
266 for (
int ij = 0; ij <
netamx; ij++) {
267 sprintf(
name,
"sigeta_%i_%i_%i", kl, jk, ij);
275 for (
int kl = 0; kl <
ncut; kl++) {
276 for (
int ij = 0; ij <
ringmx * 3; ij++) {
277 int iring = ij %
ringmx - 2;
279 sprintf(
name,
"sigring_%i_%i", kl, ij);
280 sprintf(
title,
"Signal %s %s Ring%i", varnam[kl],
varcrit[iset], iring);
285 for (
int kl = 0; kl <
ncut; kl++) {
286 for (
int ij = 0; ij <
ringmx * 3; ij++) {
287 int iring = ij %
ringmx - 2;
289 sprintf(
name,
"varring_%i_%i", kl, ij);
290 sprintf(
title,
"%s %s Ring%i", varnam[kl],
varcrit[iset], iring);
291 variab[ij][kl] =
fs->make<TH1F>(
name,
title, nbinxx[kl], alowxx[kl], ahghxx[kl]);
295 for (
int ij = 0; ij <=
ncut; ij++) {
296 sprintf(
name,
"mu_projection_%i", ij);
298 sprintf(
title,
"All projected muon");
300 sprintf(
title,
"Projected muon with selection %s", varnam[ij - 1]);
306 for (
int ij = 0; ij < 31; ij++) {
309 for (
int ij = 0; ij <
ringmx; ij++) {
310 for (
int jk = 0; jk <
ncut + 10; jk++) {
318 <<
nevents[1] <<
" " << std::setw(7) <<
nevents[2] <<
" " << std::setw(7)
319 <<
nevents[3] <<
" " << std::setw(7) <<
nevents[4] <<
" " << std::setw(7)
329 edm::InputTag(
"hoCalibProducer",
"HOCalibVariableCollection"));
331 desc.addUntracked<
bool>(
"cosmic",
true);
332 desc.addUntracked<
bool>(
"zeroField",
false);
333 desc.addUntracked<
int>(
"HOSignalBins", 120);
334 desc.addUntracked<
double>(
"lowerRange", -1.0);
335 desc.addUntracked<
double>(
"upperRange", 29.0);
336 desc.addUntracked<
bool>(
"histFill",
true);
337 desc.addUntracked<
bool>(
"treeFill",
false);
338 desc.addUntracked<
double>(
"sigma", 0.05);
339 desc.addUntracked<
bool>(
"verbose",
false);
340 descriptions.
add(
"hoCalibAnalyzer",
desc);
354 <<
nevents[1] <<
" " << std::setw(7) <<
nevents[2] <<
" " << std::setw(7)
355 <<
nevents[3] <<
" " << std::setw(7) <<
nevents[4] <<
" " << std::setw(7)
363 nmuon = (*HOCalib).size();
365 for (HOCalibVariableCollection::const_iterator hoC = (*HOCalib).begin(); hoC != (*HOCalib).end(); hoC++) {
366 trkdr = (*hoC).trkdr;
367 trkdz = (*hoC).trkdz;
369 trkvx = (*hoC).trkvx;
370 trkvy = (*hoC).trkvy;
371 trkvz = (*hoC).trkvz;
373 trkmm = (*hoC).trkmm;
374 trkth = (*hoC).trkth;
375 trkph = (*hoC).trkph;
377 ndof =
static_cast<int>((*hoC).ndof);
378 chisq = (*hoC).chisq;
381 therr = (*hoC).therr;
382 pherr = (*hoC).pherr;
383 trkph = (*hoC).trkph;
386 nprim = (*hoC).nprim;
393 isect = (*hoC).isect;
397 hoang = (*hoC).hoang;
401 htime = (*hoC).htime;
403 for (
int ij = 0; ij < 9; ij++) {
404 hosig[ij] = (*hoC).hosig[ij];
408 for (
int ij = 0; ij < 18; ij++) {
413 hocro = (*hoC).hocro;
414 for (
int ij = 0; ij < 3; ij++) {
415 caloen[ij] = (*hoC).caloen[ij];
435 bool isZSps = (
hosig[4] < -99.0) ?
false :
true;
453 int iring2 = iring + 2;
486 if (
pherr < 0.0002) {
490 if (abshoang > 0.60 && abshoang < 1.0) {
513 if (std::fabs(
hodx) < 100 && std::fabs(
hodx) > 2 && std::fabs(
hocorsig[8]) < 40 &&
519 if (std::fabs(
hody) < 100 && std::fabs(
hody) > 2 && std::fabs(
hocorsig[9]) < 40 &&
526 if (std::fabs(
hodx) < 100 && std::fabs(
hodx) > 2) {
531 if (std::fabs(
hody) < 100 && std::fabs(
hody) > 2) {
593 if (
therr < 0.00002) {
597 if (
pherr < 0.000002) {
612 if ((iring2 == 1 || iring2 == 3) && std::fabs(
momatho) > 17.0) {
616 if ((iring2 == 0 || iring2 == 4) && std::fabs(
momatho) > 20.0) {
637 if (std::fabs(
hodx) < 100 && std::fabs(
hodx) > 2 && std::fabs(
hocorsig[8]) < 40 &&
643 if (std::fabs(
hody) < 100 && std::fabs(
hody) > 2 && std::fabs(
hocorsig[9]) < 40 &&
650 if (std::fabs(
hodx) < 100 && std::fabs(
hodx) > 2) {
655 if (std::fabs(
hody) < 100 && std::fabs(
hody) > 2) {
945 if (abshoang > 0.01) {
963 if (abshoang > 0.01) {
998 int iselect = (ipsall ==
mypow_2[
ncut] - 1) ? 1 : 0;
static const std::string kSharedResource
Log< level::Info, true > LogVerbatim
const edm::EDGetTokenT< HORecHitCollection > tok_allho_
const edm::EDGetTokenT< HOCalibVariableCollection > tok_ho_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
HOCalibAnalyzer(const edm::ParameterSet &)
Sin< T >::type sin(const T &t)
void analyze(const edm::Event &, const edm::EventSetup &) override
static constexpr int ncut
TH1F * variab[3 *netamx][ncut]
TH1F * ho_indenergy[netamx][nphimx]
edm::InputTag hoCalibVariableCollectionTag
TH2F * sig_eta_evt[3 *netamx][ncut]
static constexpr int nphimx
static constexpr int ringmx
float ncount[ringmx][ncut+10]
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
int invert_HOieta(int ieta)
constexpr double piRadians(M_PI)
std::vector< HOCalibVariables > HOCalibVariableCollection
collection of HOcalibration variabale
void add(std::string const &label, ParameterSetDescription const &psetDescription)
static constexpr int netamx
TH2F * sigvsevt[3 *netamx][ncut]
~HOCalibAnalyzer() override
TH2F * mu_projection[ncut+1]
Power< A, B >::type pow(const A &a, const B &b)