155 bool checkModuleIds(
const unsigned int,
const std::vector<unsigned int>&)
const;
179 bool inUintInterval(
const std::vector<unsigned int>&,
const unsigned int,
const unsigned int =999)
const;
228 parameterSet_(iConfig),
231 trackCut_(
false), maxTracksPerEvent_(parameterSet_.getParameter<unsigned int>(
"maxTracksPerEvent")),
232 minGoodHitsPerTrack_(parameterSet_.getParameter<unsigned int>(
"minGoodHitsPerTrack")),
233 analyzerMode_(parameterSet_.getParameter<bool>(
"analyzerMode")),
234 calculateApe_(parameterSet_.getParameter<bool>(
"calculateApe"))
262 tkTreeFile->GetObject(
"TrackerTreeGenerator/TrackerTree/TrackerTree",tkTree);
266 edm::LogError(
"SectorBuilder")<<
"TrackerTree not found in file";
269 UInt_t rawId(999), subdetId(999), layer(999), side(999), half(999), rod(999),
ring(999), petal(999),
270 blade(999), panel(999), outerInner(999),
module(999), rodAl(999), bladeAl(999), nStrips(999);
271 Bool_t isDoubleSide(
false), isRPhi(
false);
272 Int_t uDirection(999), vDirection(999), wDirection(999);
273 Float_t posR(999.
F), posPhi(999.
F), posEta(999.
F), posX(999.
F), posY(999.
F), posZ(999.
F);
274 tkTree->SetBranchAddress(
"RawId", &rawId);
275 tkTree->SetBranchAddress(
"SubdetId", &subdetId);
276 tkTree->SetBranchAddress(
"Layer", &layer);
277 tkTree->SetBranchAddress(
"Side", &side);
278 tkTree->SetBranchAddress(
"Half", &half);
279 tkTree->SetBranchAddress(
"Rod", &rod);
280 tkTree->SetBranchAddress(
"Ring", &
ring);
281 tkTree->SetBranchAddress(
"Petal", &petal);
282 tkTree->SetBranchAddress(
"Blade", &blade);
283 tkTree->SetBranchAddress(
"Panel", &panel);
284 tkTree->SetBranchAddress(
"OuterInner", &outerInner);
285 tkTree->SetBranchAddress(
"Module", &
module);
286 tkTree->SetBranchAddress(
"RodAl", &rodAl);
287 tkTree->SetBranchAddress(
"BladeAl", &bladeAl);
288 tkTree->SetBranchAddress(
"NStrips", &nStrips);
289 tkTree->SetBranchAddress(
"IsDoubleSide", &isDoubleSide);
290 tkTree->SetBranchAddress(
"IsRPhi", &isRPhi);
291 tkTree->SetBranchAddress(
"UDirection", &uDirection);
292 tkTree->SetBranchAddress(
"VDirection", &vDirection);
293 tkTree->SetBranchAddress(
"WDirection", &wDirection);
294 tkTree->SetBranchAddress(
"PosR", &posR);
295 tkTree->SetBranchAddress(
"PosPhi", &posPhi);
296 tkTree->SetBranchAddress(
"PosEta", &posEta);
297 tkTree->SetBranchAddress(
"PosX", &posX);
298 tkTree->SetBranchAddress(
"PosY", &posY);
299 tkTree->SetBranchAddress(
"PosZ", &posZ);
301 Int_t nModules(tkTree->GetEntries());
305 unsigned int sectorCounter(1);
307 edm::LogInfo(
"SectorBuilder")<<
"There are "<<v_sectorDef.size()<<
" Sectors definded";
308 std::vector<edm::ParameterSet>::const_iterator i_parSet;
309 for(i_parSet = v_sectorDef.begin(); i_parSet != v_sectorDef.end();++i_parSet, ++sectorCounter){
312 std::vector<unsigned int> v_rawId(parSet.
getParameter<std::vector<unsigned int> >(
"rawId")),
313 v_subdetId(parSet.
getParameter<std::vector<unsigned int> >(
"subdetId")),
314 v_layer(parSet.
getParameter<std::vector<unsigned int> >(
"layer")),
315 v_side(parSet.
getParameter<std::vector<unsigned int> >(
"side")),
316 v_half(parSet.
getParameter<std::vector<unsigned int> >(
"half")),
317 v_rod(parSet.
getParameter<std::vector<unsigned int> >(
"rod")),
318 v_ring(parSet.
getParameter<std::vector<unsigned int> >(
"ring")),
319 v_petal(parSet.
getParameter<std::vector<unsigned int> >(
"petal")),
320 v_blade(parSet.
getParameter<std::vector<unsigned int> >(
"blade")),
321 v_panel(parSet.
getParameter<std::vector<unsigned int> >(
"panel")),
322 v_outerInner(parSet.
getParameter<std::vector<unsigned int> >(
"outerInner")),
323 v_module(parSet.
getParameter<std::vector<unsigned int> >(
"module")),
324 v_rodAl(parSet.
getParameter<std::vector<unsigned int> >(
"rodAl")),
325 v_bladeAl(parSet.
getParameter<std::vector<unsigned int> >(
"bladeAl")),
326 v_nStrips(parSet.
getParameter<std::vector<unsigned int> >(
"nStrips")),
327 v_isDoubleSide(parSet.
getParameter<std::vector<unsigned int> >(
"isDoubleSide")),
328 v_isRPhi(parSet.
getParameter<std::vector<unsigned int> >(
"isRPhi"));
329 std::vector<int> v_uDirection(parSet.
getParameter<std::vector<int> >(
"uDirection")),
330 v_vDirection(parSet.
getParameter<std::vector<int> >(
"vDirection")),
331 v_wDirection(parSet.
getParameter<std::vector<int> >(
"wDirection"));
332 std::vector<double> v_posR(parSet.
getParameter<std::vector<double> >(
"posR")),
333 v_posPhi(parSet.
getParameter<std::vector<double> >(
"posPhi")),
334 v_posEta(parSet.
getParameter<std::vector<double> >(
"posEta")),
335 v_posX(parSet.
getParameter<std::vector<double> >(
"posX")),
336 v_posY(parSet.
getParameter<std::vector<double> >(
"posY")),
337 v_posZ(parSet.
getParameter<std::vector<double> >(
"posZ"));
345 tkSector.
name = sectorName;
353 if(sectorCounter==1){
389 tkSector.
v_rawId.push_back(rawId);
390 bool moduleSelected(
false);
391 for(std::vector<unsigned int>::const_iterator i_rawId = allSectors.v_rawId.begin();
392 i_rawId != allSectors.v_rawId.end(); ++i_rawId){
393 if(rawId == *i_rawId)moduleSelected =
true;
395 if(!moduleSelected)allSectors.v_rawId.push_back(rawId);
400 for(std::vector<unsigned int>::const_iterator i_rawId = tkSector.
v_rawId.begin();
401 i_rawId != tkSector.
v_rawId.end(); ++i_rawId){
411 if(isPixel && isStrip){
412 edm::LogError(
"SectorBuilder")<<
"Incorrect Sector Definition: there are pixel and strip modules within one sector"
413 <<
"\n... sector selection is not applied, sector "<<sectorCounter<<
" is not built";
419 edm::LogInfo(
"SectorBuilder")<<
"There are "<<tkSector.
v_rawId.size()<<
" Modules in Sector "<<sectorCounter;
432 if(v_id.size()==0)
return true;
433 if(v_id.size()%2==1){
434 edm::LogError(
"SectorBuilder")<<
"Incorrect Sector Definition: Position Vectors need even number of arguments (Intervals)"
435 <<
"\n... sector selection is not applied, sector "<<sectorCounter<<
" is not built";
438 int entry(1);
double intervalBegin(999.);
439 for(std::vector<double>::const_iterator i_id = v_id.begin(); i_id != v_id.end(); ++i_id, ++entry){
440 if(entry%2==1)intervalBegin = *i_id;
441 if(entry%2==0 && intervalBegin>*i_id){
442 edm::LogError(
"SectorBuilder")<<
"Incorrect Sector Definition (Position Vector Intervals): \t"
443 <<intervalBegin<<
" is bigger than "<<*i_id<<
" but is expected to be smaller"
444 <<
"\n... sector selection is not applied, sector "<<sectorCounter<<
" is not built";
453 if(v_id.size()==0)
return true;
454 for(std::vector<unsigned int>::const_iterator i_id = v_id.begin(); i_id != v_id.end(); ++i_id){
455 if(
id==*i_id)
return true;
462 if(v_id.size()==0)
return true;
463 for(std::vector<unsigned int>::const_iterator i_id = v_id.begin(); i_id != v_id.end(); ++i_id){
464 if(1==*i_id &&
id)
return true;
465 if(2==*i_id && !
id)
return true;
472 if(v_id.size()==0)
return true;
473 for(std::vector<int>::const_iterator i_id = v_id.begin(); i_id != v_id.end(); ++i_id){
474 if(
id==*i_id)
return true;
481 if(v_id.size()==0)
return true;
482 int entry(1);
double intervalBegin(999.);
483 for(std::vector<double>::const_iterator i_id = v_id.begin(); i_id != v_id.end(); ++i_id, ++entry){
484 if(entry%2==1)intervalBegin = *i_id;
485 if(entry%2==0 &&
id>=intervalBegin &&
id<*i_id)
return true;
492 bool commonModules(
false);
493 for(std::map<unsigned int,TrackerSectorStruct>::const_iterator i_sector =
m_tkSector_.begin(); i_sector !=
m_tkSector_.end(); ++i_sector){
494 std::map<unsigned int,TrackerSectorStruct>::const_iterator i_sector2(i_sector);
495 for(++i_sector2; i_sector2 !=
m_tkSector_.end(); ++i_sector2){
496 unsigned int nCommonModules(0);
497 for(std::vector<unsigned int>::const_iterator i_module = (*i_sector).second.v_rawId.begin(); i_module != (*i_sector).second.v_rawId.end(); ++i_module){
498 for(std::vector<unsigned int>::const_iterator i_module2 = (*i_sector2).second.v_rawId.begin(); i_module2 != (*i_sector2).second.v_rawId.end(); ++i_module2){
499 if(*i_module2 == *i_module)++nCommonModules;
502 if(nCommonModules==0)
505 edm::LogError(
"SectorBuilder")<<
"Sector "<<(*i_sector).first<<
" and Sector "<<(*i_sector2).first<<
" have "<<nCommonModules<<
" Modules in common";
506 commonModules =
true;
510 if(static_cast<int>(allSectors.
v_rawId.size())==nModules)
511 edm::LogInfo(
"SectorBuilder")<<
"ALL Tracker Modules are contained in the Sectors";
514 <<
" out of "<<nModules<<
" Tracker Modules";
516 edm::LogInfo(
"SectorBuilder")<<
"There are ZERO modules associated to different sectors, no ambiguities exist";
518 edm::LogError(
"SectorBuilder")<<
"There are modules associated to different sectors, APE value cannot be assigned reasonably";
528 if(v_residualErrorBinning.size()==1){
529 edm::LogError(
"ResidualErrorBinning")<<
"Incorrect selection of Residual Error Bins (used for APE calculation): \t"
530 <<
"Only one argument passed, so no interval is specified"
531 <<
"\n... delete whole bin selection";
534 double xMin(0.), xMax(0.);
535 unsigned int binCounter(0);
536 for(std::vector<double>::const_iterator i_binning = v_residualErrorBinning.begin(); i_binning != v_residualErrorBinning.end(); ++i_binning, ++binCounter){
537 if(binCounter == 0){xMin = *i_binning;
continue;}
540 edm::LogError(
"ResidualErrorBinning")<<
"Incorrect selection of Residual Error Bins (used for APE calculation): \t"
541 <<xMin<<
" is bigger than "<<xMax<<
" but is expected to be smaller"
542 <<
"\n... delete whole bin selection";
550 edm::LogInfo(
"ResidualErrorBinning")<<
m_resErrBins_.size()<<
" Intervals of residual errors used for separate APE calculation sucessfully set";
563 for(std::vector<unsigned int>::iterator i_errHists = v_errHists.begin(); i_errHists != v_errHists.end(); ++i_errHists){
564 for(std::vector<unsigned int>::iterator i_errHists2 = i_errHists; i_errHists2 != v_errHists.end();){
566 if(*i_errHists==*i_errHists2){
567 edm::LogError(
"BookSectorHists")<<
"Value of vErrHists in config exists twice: "<<*i_errHists<<
"\n... delete one of both";
568 v_errHists.erase(i_errHists2);
574 for(std::map<unsigned int,TrackerSectorStruct>::iterator i_sector =
m_tkSector_.begin(); i_sector !=
m_tkSector_.end(); ++i_sector){
577 double widthMax = zoomHists ? 20. : 200.;
578 double chargePixelMax = zoomHists ? 200000. : 2000000.;
579 double chargeStripMax = zoomHists ? 1000. : 10000.;
580 double sOverNMax = zoomHists ? 200. : 2000.;
581 double logClusterProbMin = zoomHists ? -5. : -15.;
583 double resXAbsMax = zoomHists ? 0.5 : 5.;
584 double norResXAbsMax = zoomHists ? 10. : 50.;
585 double probXMin = zoomHists ? -0.01 : -0.1;
586 double probXMax = zoomHists ? 0.11 : 1.1;
587 double sigmaXMin = zoomHists ? 0. : -0.05;
588 double sigmaXMax = zoomHists ? 0.02 : 1.;
589 double sigmaX2Max = sigmaXMax*sigmaXMax;
590 double sigmaXHitMax = zoomHists ? 0.02 : 1.;
591 double phiSensXMax = zoomHists ? 31. : 93.;
593 double norChi2Max = zoomHists ? 5. : 1000.;
594 double d0Max = zoomHists ? 0.02 : 40.;
595 double dzMax = zoomHists ? 15. : 100.;
596 double pMax = zoomHists ? 200. : 2000.;
597 double invPMax = zoomHists ? 0.05 : 10.;
603 "TFileService is not registered in cfg file" );
606 std::stringstream sector; sector <<
"Sector_" << (*i_sector).first;
610 (*i_sector).second.Name = secDir.
make<TH1F>(
"z_name",(*i_sector).second.name.c_str(),1,0,1);
613 if((*i_sector).second.v_rawId.size()==0){
617 (*i_sector).second.setCorrHistParams(&secDir,norResXAbsMax,sigmaXHitMax,sigmaXMax);
621 const bool pixelSector(i_sector->second.isPixel);
625 (*i_sector).second.m_correlationHistsX[
"WidthX"] = (*i_sector).second.bookCorrHistsX(
"WidthX",
"cluster width",
"w_{cl,x}",
"[# channels]",static_cast<int>(widthMax),static_cast<int>(widthMax),0.,widthMax,
"nph");
626 (*i_sector).second.m_correlationHistsX[
"BaryStripX"] = (*i_sector).second.bookCorrHistsX(
"BaryStripX",
"barycenter of cluster charge",
"b_{cl,x}",
"[# channels]",800,100,-10.,790.,
"nph");
629 (*i_sector).second.m_correlationHistsY[
"WidthY"] = (*i_sector).second.bookCorrHistsY(
"WidthY",
"cluster width",
"w_{cl,y}",
"[# channels]",static_cast<int>(widthMax),static_cast<int>(widthMax),0.,widthMax,
"nph");
630 (*i_sector).second.m_correlationHistsY[
"BaryStripY"] = (*i_sector).second.bookCorrHistsY(
"BaryStripY",
"barycenter of cluster charge",
"b_{cl,y}",
"[# channels]",800,100,-10.,790.,
"nph");
632 (*i_sector).second.m_correlationHistsX[
"ChargePixel"] = (*i_sector).second.bookCorrHistsX(
"ChargePixel",
"cluster charge",
"c_{cl}",
"[e]",100,50,0.,chargePixelMax,
"nph");
633 (*i_sector).second.m_correlationHistsX[
"ClusterProbXY"] = (*i_sector).second.bookCorrHistsX(
"ClusterProbXY",
"cluster probability xy",
"prob_{cl,xy}",
"",100,50,0.,1.,
"nph");
634 (*i_sector).second.m_correlationHistsX[
"ClusterProbQ"] = (*i_sector).second.bookCorrHistsX(
"ClusterProbQ",
"cluster probability q",
"prob_{cl,q}",
"",100,50,0.,1.,
"nph");
635 (*i_sector).second.m_correlationHistsX[
"ClusterProbXYQ"] = (*i_sector).second.bookCorrHistsX(
"ClusterProbXYQ",
"cluster probability xyq",
"prob_{cl,xyq}",
"",100,50,0.,1.,
"nph");
636 (*i_sector).second.m_correlationHistsX[
"LogClusterProb"] = (*i_sector).second.bookCorrHistsX(
"LogClusterProb",
"cluster probability xy",
"log(prob_{cl,xy})",
"",60,30,logClusterProbMin,0.,
"nph");
637 (*i_sector).second.m_correlationHistsX[
"IsOnEdge"] = (*i_sector).second.bookCorrHistsX(
"IsOnEdge",
"IsOnEdge",
"isOnEdge",
"",2,2,0,2,
"nph");
638 (*i_sector).second.m_correlationHistsX[
"HasBadPixels"] = (*i_sector).second.bookCorrHistsX(
"HasBadPixels",
"HasBadPixels",
"hasBadPixels",
"",2,2,0,2,
"nph");
639 (*i_sector).second.m_correlationHistsX[
"SpansTwoRoc"] = (*i_sector).second.bookCorrHistsX(
"SpansTwoRoc",
"SpansTwoRoc",
"spansTwoRoc",
"",2,2,0,2,
"nph");
640 (*i_sector).second.m_correlationHistsX[
"QBin"] = (*i_sector).second.bookCorrHistsX(
"QBin",
"q bin",
"q bin",
"",8,8,0,8,
"nph");
642 (*i_sector).second.m_correlationHistsY[
"ChargePixel"] = (*i_sector).second.bookCorrHistsY(
"ChargePixel",
"cluster charge",
"c_{cl}",
"[e]",100,50,0.,chargePixelMax,
"nph");
643 (*i_sector).second.m_correlationHistsY[
"ClusterProbXY"] = (*i_sector).second.bookCorrHistsY(
"ClusterProbXY",
"cluster probability xy",
"prob_{cl,xy}",
"",100,50,0.,1.,
"nph");
644 (*i_sector).second.m_correlationHistsY[
"ClusterProbQ"] = (*i_sector).second.bookCorrHistsY(
"ClusterProbQ",
"cluster probability q",
"prob_{cl,q}",
"",100,50,0.,1.,
"nph");
645 (*i_sector).second.m_correlationHistsY[
"ClusterProbXYQ"] = (*i_sector).second.bookCorrHistsY(
"ClusterProbXYQ",
"cluster probability xyq",
"prob_{cl,xyq}",
"",100,50,0.,1.,
"nph");
646 (*i_sector).second.m_correlationHistsY[
"LogClusterProb"] = (*i_sector).second.bookCorrHistsY(
"LogClusterProb",
"cluster probability xy",
"log(prob_{cl,xy})",
"",60,30,logClusterProbMin,0.,
"nph");
647 (*i_sector).second.m_correlationHistsY[
"IsOnEdge"] = (*i_sector).second.bookCorrHistsY(
"IsOnEdge",
"IsOnEdge",
"isOnEdge",
"",2,2,0,2,
"nph");
648 (*i_sector).second.m_correlationHistsY[
"HasBadPixels"] = (*i_sector).second.bookCorrHistsY(
"HasBadPixels",
"HasBadPixels",
"hasBadPixels",
"",2,2,0,2,
"nph");
649 (*i_sector).second.m_correlationHistsY[
"SpansTwoRoc"] = (*i_sector).second.bookCorrHistsY(
"SpansTwoRoc",
"SpansTwoRoc",
"spansTwoRoc",
"",2,2,0,2,
"nph");
650 (*i_sector).second.m_correlationHistsY[
"QBin"] = (*i_sector).second.bookCorrHistsY(
"QBin",
"q bin",
"q bin",
"",8,8,0,8,
"nph");
654 (*i_sector).second.m_correlationHistsX[
"ChargeStrip"] = (*i_sector).second.bookCorrHistsX(
"ChargeStrip",
"cluster charge",
"c_{cl}",
"[APV counts]",100,50,0.,chargeStripMax,
"nph");
655 (*i_sector).second.m_correlationHistsX[
"MaxStrip"] = (*i_sector).second.bookCorrHistsX(
"MaxStrip",
"strip with max. charge",
"n_{cl,max}",
"[# strips]",800,800,-10.,790.,
"npht");
656 (*i_sector).second.m_correlationHistsX[
"MaxCharge"] = (*i_sector).second.bookCorrHistsX(
"MaxCharge",
"charge of strip with max. charge",
"c_{cl,max}",
"[APV counts]",300,75,-10.,290.,
"nph");
657 (*i_sector).second.m_correlationHistsX[
"MaxIndex"] = (*i_sector).second.bookCorrHistsX(
"MaxIndex",
"cluster-index of strip with max. charge",
"i_{cl,max}",
"[# strips]",10,10,0.,10.,
"nph");
658 (*i_sector).second.m_correlationHistsX[
"ChargeOnEdges"] = (*i_sector).second.bookCorrHistsX(
"ChargeOnEdges",
"fraction of charge on edge strips",
"(c_{st,L}+c_{st,R})/c_{cl}",
"",60,60,-0.1,1.1,
"nph");
659 (*i_sector).second.m_correlationHistsX[
"ChargeAsymmetry"] = (*i_sector).second.bookCorrHistsX(
"ChargeAsymmetry",
"asymmetry of charge on edge strips",
"(c_{st,L}-c_{st,R})/c_{cl}",
"",110,55,-1.1,1.1,
"nph");
660 (*i_sector).second.m_correlationHistsX[
"ChargeLRplus"] = (*i_sector).second.bookCorrHistsX(
"ChargeLRplus",
"fraction of charge not on maxStrip",
"(c_{cl,L}+c_{cl,R})/c_{cl}",
"",60,60,-0.1,1.1,
"nph");
661 (*i_sector).second.m_correlationHistsX[
"ChargeLRminus"] = (*i_sector).second.bookCorrHistsX(
"ChargeLRminus",
"asymmetry of charge L and R of maxStrip",
"(c_{cl,L}-c_{cl,R})/c_{cl}",
"",110,55,-1.1,1.1,
"nph");
662 (*i_sector).second.m_correlationHistsX[
"SOverN"] = (*i_sector).second.bookCorrHistsX(
"SOverN",
"signal over noise",
"s/N",
"",100,50,0,sOverNMax,
"nph");
663 (*i_sector).second.m_correlationHistsX[
"WidthProj"] = (*i_sector).second.bookCorrHistsX(
"WidthProj",
"projected width",
"w_{p}",
"[# strips]",200,20,0.,widthMax,
"nph");
664 (*i_sector).second.m_correlationHistsX[
"WidthDiff"] = (*i_sector).second.bookCorrHistsX(
"WidthDiff",
"width difference",
"w_{p} - w_{cl}",
"[# strips]",200,20,-widthMax/2.,widthMax/2.,
"nph");
666 (*i_sector).second.WidthVsWidthProjected = secDir.
make<TH2F>(
"h2_widthVsWidthProj",
"w_{cl} vs. w_{p};w_{p} [# strips];w_{cl} [# strips]",
static_cast<int>(widthMax),0,widthMax,static_cast<int>(widthMax),0,widthMax);
667 (*i_sector).second.PWidthVsWidthProjected = secDir.
make<TProfile>(
"p_widthVsWidthProj",
"w_{cl} vs. w_{p};w_{p} [# strips];w_{cl} [# strips]",
static_cast<int>(widthMax),0,widthMax);
669 (*i_sector).second.WidthDiffVsMaxStrip = secDir.
make<TH2F>(
"h2_widthDiffVsMaxStrip",
"(w_{p} - w_{cl}) vs. n_{cl,max};n_{cl,max};w_{p} - w_{cl} [# strips]",800,-10.,790.,
static_cast<int>(widthMax),-widthMax/2.,widthMax/2.);
670 (*i_sector).second.PWidthDiffVsMaxStrip = secDir.
make<TProfile>(
"p_widthDiffVsMaxStrip",
"(w_{p} - w_{cl}) vs. n_{cl,max};n_{cl,max};w_{p} - w_{cl} [# strips]",800,-10.,790.);
672 (*i_sector).second.WidthDiffVsSigmaXHit = secDir.
make<TH2F>(
"h2_widthDiffVsSigmaXHit",
"(w_{p} - w_{cl}) vs. #sigma_{hit,x};#sigma_{hit,x} [cm];w_{p} - w_{cl} [# strips]",100,0.,sigmaXMax,100,-10.,10.);
673 (*i_sector).second.PWidthDiffVsSigmaXHit = secDir.
make<TProfile>(
"p_widthDiffVsSigmaXHit",
"(w_{p} - w_{cl}) vs. #sigma_{hit,x};#sigma_{hit,x} [cm];w_{p} - w_{cl} [# strips]",100,0.,sigmaXMax);
675 (*i_sector).second.WidthVsPhiSensX = secDir.
make<TH2F>(
"h2_widthVsPhiSensX",
"w_{cl} vs. #phi_{module,x};#phi_{module,x} [ ^{o}];w_{cl} [# strips]",93,-93,93,
static_cast<int>(widthMax),0,widthMax);
676 (*i_sector).second.PWidthVsPhiSensX = secDir.
make<TProfile>(
"p_widthVsPhiSensX",
"w_{cl} vs. #phi_{module,x};#phi_{module,x} [ ^{o}];w_{cl} [# strips]",93,-93,93);
681 (*i_sector).second.m_correlationHistsX[
"SigmaXHit"] = (*i_sector).second.bookCorrHistsX(
"SigmaXHit",
"hit error",
"#sigma_{hit,x}",
"[#mum]",105,20,sigmaXMin*10000.,sigmaXMax*10000.,
"np");
682 (*i_sector).second.m_correlationHistsX[
"SigmaXTrk"] = (*i_sector).second.bookCorrHistsX(
"SigmaXTrk",
"track error",
"#sigma_{trk,x}",
"[#mum]",105,20,sigmaXMin*10000.,sigmaXMax*10000.,
"np");
683 (*i_sector).second.m_correlationHistsX[
"SigmaX"] = (*i_sector).second.bookCorrHistsX(
"SigmaX",
"residual error",
"#sigma_{r,x}",
"[#mum]",105,20,sigmaXMin*10000.,sigmaXMax*10000.,
"np");
684 (*i_sector).second.m_correlationHistsX[
"PhiSens"] = (*i_sector).second.bookCorrHistsX(
"PhiSens",
"track angle on sensor",
"#phi_{module}",
"[ ^{o}]",96,48,-3,93,
"nphtr");
685 (*i_sector).second.m_correlationHistsX[
"PhiSensX"] = (*i_sector).second.bookCorrHistsX(
"PhiSensX",
"track angle on sensor",
"#phi_{module,x}",
"[ ^{o}]",186,93,-phiSensXMax,phiSensXMax,
"nphtr");
686 (*i_sector).second.m_correlationHistsX[
"PhiSensY"] = (*i_sector).second.bookCorrHistsX(
"PhiSensY",
"track angle on sensor",
"#phi_{module,y}",
"[ ^{o}]",186,93,-93,93,
"nphtr");
688 (*i_sector).second.XHit = secDir.
make<TH1F>(
"h_XHit",
" hit measurement x_{hit};x_{hit} [cm];# hits",100,-20,20);
689 (*i_sector).second.XTrk = secDir.
make<TH1F>(
"h_XTrk",
"track prediction x_{trk};x_{trk} [cm];# hits",100,-20,20);
690 (*i_sector).second.SigmaX2 = secDir.
make<TH1F>(
"h_SigmaX2",
"squared residual error #sigma_{r,x}^{2};#sigma_{r,x}^{2} [#mum^{2}];# hits",105,sigmaXMin*10000.,sigmaX2Max*10000.*10000.);
691 (*i_sector).second.ResX = secDir.
make<TH1F>(
"h_ResX",
"residual r_{x};x_{trk}-x_{hit} [#mum];# hits",100,-resXAbsMax*10000.,resXAbsMax*10000.);
692 (*i_sector).second.NorResX = secDir.
make<TH1F>(
"h_NorResX",
"normalized residual r_{x}/#sigma_{r,x};(x_{trk}-x_{hit})/#sigma_{r,x};# hits",100,-norResXAbsMax,norResXAbsMax);
693 (*i_sector).second.ProbX = secDir.
make<TH1F>(
"h_ProbX",
"residual probability;prob(r_{x}^{2}/#sigma_{r,x}^{2},1);# hits",60,probXMin,probXMax);
695 (*i_sector).second.PhiSensXVsBarycentreX = secDir.
make<TH2F>(
"h2_phiSensXVsBarycentreX",
"#phi_{module,x} vs. b_{cl,x};b_{cl,x} [# channels];#phi_{module,x} [ ^{o}]",200,-10.,790.,93,-93,93);
696 (*i_sector).second.PPhiSensXVsBarycentreX = secDir.
make<TProfile>(
"p_phiSensXVsBarycentreX",
"#phi_{module,x} vs. b_{cl,x};b_{cl,x} [# channels];#phi_{module,x} [ ^{o}]",200,-10.,790.);
699 (*i_sector).second.m_correlationHistsY[
"SigmaYHit"] = (*i_sector).second.bookCorrHistsY(
"SigmaYHit",
"hit error",
"#sigma_{hit,y}",
"[#mum]",105,20,sigmaXMin*10000.,sigmaXMax*10000.,
"np");
700 (*i_sector).second.m_correlationHistsY[
"SigmaYTrk"] = (*i_sector).second.bookCorrHistsY(
"SigmaYTrk",
"track error",
"#sigma_{trk,y}",
"[#mum]",105,20,sigmaXMin*10000.,sigmaXMax*10000.,
"np");
701 (*i_sector).second.m_correlationHistsY[
"SigmaY"] = (*i_sector).second.bookCorrHistsY(
"SigmaY",
"residual error",
"#sigma_{r,y}",
"[#mum]",105,20,sigmaXMin*10000.,sigmaXMax*10000.,
"np");
702 (*i_sector).second.m_correlationHistsY[
"PhiSens"] = (*i_sector).second.bookCorrHistsY(
"PhiSens",
"track angle on sensor",
"#phi_{module}",
"[ ^{o}]",96,48,-3,93,
"nphtr");
703 (*i_sector).second.m_correlationHistsY[
"PhiSensX"] = (*i_sector).second.bookCorrHistsY(
"PhiSensX",
"track angle on sensor",
"#phi_{module,x}",
"[ ^{o}]",186,93,-phiSensXMax,phiSensXMax,
"nphtr");
704 (*i_sector).second.m_correlationHistsY[
"PhiSensY"] = (*i_sector).second.bookCorrHistsY(
"PhiSensY",
"track angle on sensor",
"#phi_{module,y}",
"[ ^{o}]",186,93,-93,93,
"nphtr");
706 (*i_sector).second.YHit = secDir.
make<TH1F>(
"h_YHit",
" hit measurement y_{hit};y_{hit} [cm];# hits",100,-20,20);
707 (*i_sector).second.YTrk = secDir.
make<TH1F>(
"h_YTrk",
"track prediction y_{trk};y_{trk} [cm];# hits",100,-20,20);
708 (*i_sector).second.SigmaY2 = secDir.
make<TH1F>(
"h_SigmaY2",
"squared residual error #sigma_{r,y}^{2};#sigma_{r,y}^{2} [#mum^{2}];# hits",105,sigmaXMin*10000.,sigmaX2Max*10000.*10000.);
709 (*i_sector).second.ResY = secDir.
make<TH1F>(
"h_ResY",
"residual r_{y};y_{trk}-y_{hit} [#mum];# hits",100,-resXAbsMax*10000.,resXAbsMax*10000.);
710 (*i_sector).second.NorResY = secDir.
make<TH1F>(
"h_NorResY",
"normalized residual r_{y}/#sigma_{r,y};(y_{trk}-y_{hit})/#sigma_{r,y};# hits",100,-norResXAbsMax,norResXAbsMax);
711 (*i_sector).second.ProbY = secDir.
make<TH1F>(
"h_ProbY",
"residual probability;prob(r_{y}^{2}/#sigma_{r,y}^{2},1);# hits",60,probXMin,probXMax);
713 (*i_sector).second.PhiSensYVsBarycentreY = secDir.
make<TH2F>(
"h2_phiSensYVsBarycentreY",
"#phi_{module,y} vs. b_{cl,y};b_{cl,y} [# channels];#phi_{module,y} [ ^{o}]",200,-10.,790.,93,-93,93);
714 (*i_sector).second.PPhiSensYVsBarycentreY = secDir.
make<TProfile>(
"p_phiSensYVsBarycentreY",
"#phi_{module,y} vs. b_{cl,y};b_{cl,y} [# channels];#phi_{module,y} [ ^{o}]",200,-10.,790.);
719 (*i_sector).second.m_correlationHistsX[
"HitsValid"] = (*i_sector).second.bookCorrHistsX(
"HitsValid",
"# hits",
"[valid]",50,0,50,
"npt");
720 (*i_sector).second.m_correlationHistsX[
"HitsInvalid"] = (*i_sector).second.bookCorrHistsX(
"HitsInvalid",
"# hits",
"[invalid]",20,0,20,
"npt");
721 (*i_sector).second.m_correlationHistsX[
"Hits2D"] = (*i_sector).second.bookCorrHistsX(
"Hits2D",
"# hits",
"[2D]",20,0,20,
"npt");
722 (*i_sector).second.m_correlationHistsX[
"LayersMissed"] = (*i_sector).second.bookCorrHistsX(
"LayersMissed",
"# layers",
"[missed]",10,0,10,
"npt");
723 (*i_sector).second.m_correlationHistsX[
"HitsPixel"] = (*i_sector).second.bookCorrHistsX(
"HitsPixel",
"# hits",
"[pixel]",10,0,10,
"npt");
724 (*i_sector).second.m_correlationHistsX[
"HitsStrip"] = (*i_sector).second.bookCorrHistsX(
"HitsStrip",
"# hits",
"[strip]",40,0,40,
"npt");
725 (*i_sector).second.m_correlationHistsX[
"HitsGood"] = (*i_sector).second.bookCorrHistsX(
"HitsGood",
"# hits",
"[good]",50,0,50,
"npt");
726 (*i_sector).second.m_correlationHistsX[
"NorChi2"] = (*i_sector).second.bookCorrHistsX(
"NorChi2",
"#chi^{2}/f",
"",50,0,norChi2Max,
"npr");
727 (*i_sector).second.m_correlationHistsX[
"Theta"] = (*i_sector).second.bookCorrHistsX(
"Theta",
"#theta",
"[ ^{o}]",40,-10,190,
"npt");
728 (*i_sector).second.m_correlationHistsX[
"Phi"] = (*i_sector).second.bookCorrHistsX(
"Phi",
"#phi",
"[ ^{o}]",76,-190,190,
"npt");
729 (*i_sector).second.m_correlationHistsX[
"D0Beamspot"] = (*i_sector).second.bookCorrHistsX(
"D0Beamspot",
"d_{0, BS}",
"[cm]",40,-d0Max,d0Max,
"npt");
730 (*i_sector).second.m_correlationHistsX[
"Dz"] = (*i_sector).second.bookCorrHistsX(
"Dz",
"d_{z}",
"[cm]",40,-dzMax,dzMax,
"npt");
731 (*i_sector).second.m_correlationHistsX[
"Pt"] = (*i_sector).second.bookCorrHistsX(
"Pt",
"p_{t}",
"[GeV]",50,0,pMax,
"npt");
732 (*i_sector).second.m_correlationHistsX[
"P"] = (*i_sector).second.bookCorrHistsX(
"P",
"|p|",
"[GeV]",50,0,pMax,
"npt");
733 (*i_sector).second.m_correlationHistsX[
"InvP"] = (*i_sector).second.bookCorrHistsX(
"InvP",
"1/|p|",
"[GeV^{-1}]",25,0,invPMax,
"t");
734 (*i_sector).second.m_correlationHistsX[
"MeanAngle"] = (*i_sector).second.bookCorrHistsX(
"MeanAngle",
"<#phi_{module}>",
"[ ^{o}]",25,-5,95,
"npt");
738 (*i_sector).second.m_correlationHistsY[
"HitsValid"] = (*i_sector).second.bookCorrHistsY(
"HitsValid",
"# hits",
"[valid]",50,0,50,
"npt");
739 (*i_sector).second.m_correlationHistsY[
"HitsInvalid"] = (*i_sector).second.bookCorrHistsY(
"HitsInvalid",
"# hits",
"[invalid]",20,0,20,
"npt");
740 (*i_sector).second.m_correlationHistsY[
"Hits2D"] = (*i_sector).second.bookCorrHistsY(
"Hits2D",
"# hits",
"[2D]",20,0,20,
"npt");
741 (*i_sector).second.m_correlationHistsY[
"LayersMissed"] = (*i_sector).second.bookCorrHistsY(
"LayersMissed",
"# layers",
"[missed]",10,0,10,
"npt");
742 (*i_sector).second.m_correlationHistsY[
"HitsPixel"] = (*i_sector).second.bookCorrHistsY(
"HitsPixel",
"# hits",
"[pixel]",10,0,10,
"npt");
743 (*i_sector).second.m_correlationHistsY[
"HitsStrip"] = (*i_sector).second.bookCorrHistsY(
"HitsStrip",
"# hits",
"[strip]",40,0,40,
"npt");
744 (*i_sector).second.m_correlationHistsY[
"HitsGood"] = (*i_sector).second.bookCorrHistsY(
"HitsGood",
"# hits",
"[good]",50,0,50,
"npt");
745 (*i_sector).second.m_correlationHistsY[
"NorChi2"] = (*i_sector).second.bookCorrHistsY(
"NorChi2",
"#chi^{2}/f",
"",50,0,norChi2Max,
"npr");
746 (*i_sector).second.m_correlationHistsY[
"Theta"] = (*i_sector).second.bookCorrHistsY(
"Theta",
"#theta",
"[ ^{o}]",40,-10,190,
"npt");
747 (*i_sector).second.m_correlationHistsY[
"Phi"] = (*i_sector).second.bookCorrHistsY(
"Phi",
"#phi",
"[ ^{o}]",76,-190,190,
"npt");
748 (*i_sector).second.m_correlationHistsY[
"D0Beamspot"] = (*i_sector).second.bookCorrHistsY(
"D0Beamspot",
"d_{0, BS}",
"[cm]",40,-d0Max,d0Max,
"npt");
749 (*i_sector).second.m_correlationHistsY[
"Dz"] = (*i_sector).second.bookCorrHistsY(
"Dz",
"d_{z}",
"[cm]",40,-dzMax,dzMax,
"npt");
750 (*i_sector).second.m_correlationHistsY[
"Pt"] = (*i_sector).second.bookCorrHistsY(
"Pt",
"p_{t}",
"[GeV]",50,0,pMax,
"npt");
751 (*i_sector).second.m_correlationHistsY[
"P"] = (*i_sector).second.bookCorrHistsY(
"P",
"|p|",
"[GeV]",50,0,pMax,
"npt");
752 (*i_sector).second.m_correlationHistsY[
"InvP"] = (*i_sector).second.bookCorrHistsY(
"InvP",
"1/|p|",
"[GeV^{-1}]",25,0,invPMax,
"t");
753 (*i_sector).second.m_correlationHistsY[
"MeanAngle"] = (*i_sector).second.bookCorrHistsY(
"MeanAngle",
"<#phi_{module}>",
"[ ^{o}]",25,-5,95,
"npt");
758 for(std::vector<unsigned int>::iterator i_errHists = v_errHists.begin(); i_errHists != v_errHists.end(); ++i_errHists){
759 double xMin(0.01*(*i_errHists-1)), xMax(0.01*(*i_errHists));
760 std::stringstream sigmaXHit, sigmaXTrk, sigmaX;
761 sigmaXHit <<
"h_sigmaXHit_" << *i_errHists;
762 sigmaXTrk <<
"h_sigmaXTrk_" << *i_errHists;
763 sigmaX <<
"h_sigmaX_" << *i_errHists;
764 (*i_sector).second.m_sigmaX[
"sigmaXHit"].push_back(secDir.
make<TH1F>(sigmaXHit.str().c_str(),
"hit error #sigma_{hit,x};#sigma_{hit,x} [#mum];# hits",100,xMin*10000.,xMax*10000.));
765 (*i_sector).second.m_sigmaX[
"sigmaXTrk"].push_back(secDir.
make<TH1F>(sigmaXTrk.str().c_str(),
"track error #sigma_{trk,x};#sigma_{trk,x} [#mum];# hits",100,xMin*10000.,xMax*10000.));
766 (*i_sector).second.m_sigmaX[
"sigmaX" ].push_back(secDir.
make<TH1F>(sigmaX.str().c_str(),
"residual error #sigma_{r,x};#sigma_{r,x} [#mum];# hits",100,xMin*10000.,xMax*10000.));
768 std::stringstream sigmaYHit, sigmaYTrk, sigmaY;
769 sigmaYHit <<
"h_sigmaYHit_" << *i_errHists;
770 sigmaYTrk <<
"h_sigmaYTrk_" << *i_errHists;
771 sigmaY <<
"h_sigmaY_" << *i_errHists;
772 (*i_sector).second.m_sigmaY[
"sigmaYHit"].push_back(secDir.
make<TH1F>(sigmaYHit.str().c_str(),
"hit error #sigma_{hit,y};#sigma_{hit,y} [#mum];# hits",100,xMin*10000.,xMax*10000.));
773 (*i_sector).second.m_sigmaY[
"sigmaYTrk"].push_back(secDir.
make<TH1F>(sigmaYTrk.str().c_str(),
"track error #sigma_{trk,y};#sigma_{trk,y} [#mum];# hits",100,xMin*10000.,xMax*10000.));
774 (*i_sector).second.m_sigmaY[
"sigmaY" ].push_back(secDir.
make<TH1F>(sigmaY.str().c_str(),
"residual error #sigma_{r,y};#sigma_{r,y} [#mum];# hits",100,xMin*10000.,xMax*10000.));
787 for(std::vector<unsigned int>::iterator i_errHists = v_errHists.begin(); i_errHists != v_errHists.end(); ++i_errHists){
788 for(std::vector<unsigned int>::iterator i_errHists2 = i_errHists; i_errHists2 != v_errHists.end();){
790 if(*i_errHists==*i_errHists2){
791 edm::LogError(
"BookSectorHists")<<
"Value of vErrHists in config exists twice: "<<*i_errHists<<
"\n... delete one of both";
792 v_errHists.erase(i_errHists2);
797 for(std::map<unsigned int,TrackerSectorStruct>::iterator i_sector =
m_tkSector_.begin(); i_sector !=
m_tkSector_.end(); ++i_sector){
802 "TFileService is not registered in cfg file" );
805 std::stringstream sector; sector <<
"Sector_" << (*i_sector).first;
809 (*i_sector).second.Name = secDir.
make<TH1F>(
"z_name",(*i_sector).second.name.c_str(),1,0,1);
812 if((*i_sector).second.v_rawId.size()==0){
819 for(
std::map<
unsigned int,std::pair<double,double> >::const_iterator i_errBins =
m_resErrBins_.begin();
821 std::stringstream
interval; interval <<
"Interval_" << (*i_errBins).first;
823 (*i_sector).second.m_binnedHists[(*i_errBins).first][
"sigmaX"] = intDir.
make<TH1F>(
"h_sigmaX",
"residual resolution #sigma_{x};#sigma_{x} [cm];# hits",100,0.,0.01);
824 (*i_sector).second.m_binnedHists[(*i_errBins).first][
"norResX"] = intDir.
make<TH1F>(
"h_norResX",
"normalized residual r_{x}/#sigma_{r,x};(x_{trk}-x_{hit})/#sigma_{r,x};# hits",100,-10,10);
825 if((*i_sector).second.isPixel){
826 (*i_sector).second.m_binnedHists[(*i_errBins).first][
"sigmaY"] = intDir.
make<TH1F>(
"h_sigmaY",
"residual resolution #sigma_{y};#sigma_{y} [cm];# hits",100,0.,0.01);
827 (*i_sector).second.m_binnedHists[(*i_errBins).first][
"norResY"] = intDir.
make<TH1F>(
"h_norResY",
"normalized residual r_{y}/#sigma_{r,y};(y_{trk}-y_{hit})/#sigma_{r,y};# hits",100,-10,10);
835 unsigned int rawId(0);
836 (*i_sector).second.RawId = resDir.
make<TTree>(
"rawIdTree",
"Tree containing rawIds of all modules in sector");
837 (*i_sector).second.RawId->Branch(
"RawId", &rawId,
"RawId/i");
838 for(std::vector<unsigned int>::const_iterator i_rawId=(*i_sector).second.v_rawId.begin(); i_rawId!=(*i_sector).second.v_rawId.end(); ++i_rawId){
840 (*i_sector).second.RawId->Fill();
846 for(std::vector<double>::iterator i_binX = v_binX.begin(); i_binX != v_binX.end(); ++i_binX){
849 (*i_sector).second.EntriesX = resDir.
make<TH1F>(
"h_entriesX",
"# hits used;#sigma_{x} [#mum];# hits",v_binX.size()-1,&(v_binX[0]));
850 if((*i_sector).second.isPixel){
851 (*i_sector).second.EntriesY = resDir.
make<TH1F>(
"h_entriesY",
"# hits used;#sigma_{y} [#mum];# hits",v_binX.size()-1,&(v_binX[0]));
856 (*i_sector).second.ResX = resDir.
make<TH1F>(
"h_ResX",
"residual r_{x};x_{trk}-x_{hit} [#mum];# hits",100,-0.03*10000.,0.03*10000.);
857 (*i_sector).second.NorResX = resDir.
make<TH1F>(
"h_NorResX",
"normalized residual r_{x}/#sigma_{r,x};(x_{trk}-x_{hit})/#sigma_{r,x};# hits",100,-5.,5.);
858 if((*i_sector).second.isPixel){
859 (*i_sector).second.ResY = resDir.
make<TH1F>(
"h_ResY",
"residual r_{y};y_{trk}-y_{hit} [#mum];# hits",100,-0.03*10000.,0.03*10000.);
860 (*i_sector).second.NorResY = resDir.
make<TH1F>(
"h_NorResY",
"normalized residual r_{y}/#sigma_{r,y};(y_{trk}-y_{hit})/#sigma_{r,y};# hits",100,-5.,5.);
873 int trackSizeBins = zoomHists ? 6 : 201;
874 double trackSizeMax = trackSizeBins -1;
876 double chi2Max = zoomHists ? 100. : 2000.;
877 double norChi2Max = zoomHists ? 5. : 1000.;
878 double d0max = zoomHists ? 0.02 : 40.;
879 double dzmax = zoomHists ? 15. : 100.;
880 double pMax = zoomHists ? 200. : 2000.;
884 tkDetector_.
TrkSize = evtDir.
make<TH1F>(
"h_trackSize",
"# tracks [all];# tracks;# events",trackSizeBins,-1,trackSizeMax);
885 tkDetector_.
TrkSizeGood = evtDir.
make<TH1F>(
"h_trackSizeGood",
"# tracks [good];# tracks;# events",trackSizeBins,-1,trackSizeMax);
888 tkDetector_.
HitsValid = trkDir.make<TH1F>(
"h_hitsValid",
"# hits [valid];# hits [valid];# tracks",51,-1,50);
889 tkDetector_.
HitsInvalid = trkDir.make<TH1F>(
"h_hitsInvalid",
"# hits [invalid];# hits [invalid];# tracks",21,-1,20);
890 tkDetector_.
Hits2D = trkDir.make<TH1F>(
"h_hits2D",
"# hits [2D];# hits [2D];# tracks",21,-1,20);
891 tkDetector_.
LayersMissed = trkDir.make<TH1F>(
"h_layersMissed",
"# layers [missed];# layers [missed];# tracks",11,-1,10);
892 tkDetector_.
HitsPixel = trkDir.make<TH1F>(
"h_hitsPixel",
"# hits [pixel];# hits [pixel];# tracks",11,-1,10);
893 tkDetector_.
HitsStrip = trkDir.make<TH1F>(
"h_hitsStrip",
"# hits [strip];# hits [strip];# tracks",41,-1,40);
894 tkDetector_.
Charge = trkDir.make<TH1F>(
"h_charge",
"charge q;q [e];# tracks",5,-2,3);
895 tkDetector_.
Chi2 = trkDir.make<TH1F>(
"h_chi2",
" #chi^{2};#chi^{2};# tracks",100,0,chi2Max);
896 tkDetector_.
Ndof = trkDir.make<TH1F>(
"h_ndof",
"# degrees of freedom f;f;# tracks",101,-1,100);
897 tkDetector_.
NorChi2 = trkDir.make<TH1F>(
"h_norChi2",
"normalized #chi^{2};#chi^{2}/f;# tracks",200,0,norChi2Max);
898 tkDetector_.
Prob = trkDir.make<TH1F>(
"h_prob",
" #chi^{2} probability;prob(#chi^{2},f);# tracks",50,0,1);
899 tkDetector_.
Eta = trkDir.make<TH1F>(
"h_eta",
"pseudorapidity #eta;#eta;# tracks",100,-5,5);
900 tkDetector_.
EtaErr = trkDir.make<TH1F>(
"h_etaErr",
"Error of #eta;#sigma(#eta);# tracks",100,0,0.001);
901 tkDetector_.
EtaSig = trkDir.make<TH1F>(
"h_etaSig",
"Significance of #eta;#eta/#sigma(#eta);# tracks",100,-20000,20000);
902 tkDetector_.
Theta = trkDir.make<TH1F>(
"h_theta",
"polar angle #theta;#theta [ ^{o}];# tracks",100,-10,190);
903 tkDetector_.
Phi = trkDir.make<TH1F>(
"h_phi",
"azimuth angle #phi;#phi [ ^{o}];# tracks",190,-190,190);
904 tkDetector_.
PhiErr = trkDir.make<TH1F>(
"h_phiErr",
"Error of #phi;#sigma(#phi) [ ^{o}];# tracks",100,0,0.04);
905 tkDetector_.
PhiSig = trkDir.make<TH1F>(
"h_phiSig",
"Significance of #phi;#phi/#sigma(#phi) [ ^{o}];# tracks",100,-50000,50000);
906 tkDetector_.
D0Beamspot = trkDir.make<TH1F>(
"h_d0Beamspot",
"Closest approach d_{0} wrt. beamspot;d_{0, BS} [cm];# tracks",200,-d0max,d0max);
907 tkDetector_.
D0BeamspotErr = trkDir.make<TH1F>(
"h_d0BeamspotErr",
"Error of d_{0, BS};#sigma(d_{0, BS}) [cm];# tracks",200,0,0.01);
908 tkDetector_.
D0BeamspotSig = trkDir.make<TH1F>(
"h_d0BeamspotSig",
"Significance of d_{0, BS};d_{0, BS}/#sigma(d_{0, BS});# tracks",100,-5,5);
909 tkDetector_.
Dz = trkDir.make<TH1F>(
"h_dz",
"Closest approach d_{z};d_{z} [cm];# tracks",200,-dzmax,dzmax);
910 tkDetector_.
DzErr = trkDir.make<TH1F>(
"h_dzErr",
"Error of d_{z};#sigma(d_{z}) [cm];# tracks",200,0,0.01);
911 tkDetector_.
DzSig = trkDir.make<TH1F>(
"h_dzSig",
"Significance of d_{z};d_{z}/#sigma(d_{z});# tracks",100,-10000,10000);
912 tkDetector_.
Pt = trkDir.make<TH1F>(
"h_pt",
"transverse momentum p_{t};p_{t} [GeV];# tracks",100,0,pMax);
913 tkDetector_.
PtErr = trkDir.make<TH1F>(
"h_ptErr",
"Error of p_{t};#sigma(p_{t}) [GeV];# tracks",100,0,1.6);
914 tkDetector_.
PtSig = trkDir.make<TH1F>(
"h_ptSig",
"Significance of p_{t};p_{t}/#sigma(p_{t});# tracks",100,0,200);
915 tkDetector_.
P = trkDir.make<TH1F>(
"h_p",
"momentum magnitude |p|;|p| [GeV];# tracks",100,0,pMax);
916 tkDetector_.
MeanAngle = trkDir.make<TH1F>(
"h_meanAngle",
"mean angle on module <#phi_{module}>;<#phi_{module}> [ ^{o}];# tracks",100,-5,95);
917 tkDetector_.
HitsGood = trkDir.make<TH1F>(
"h_hitsGood",
"# hits [good];# hits [good];# tracks",51,-1,50);
919 tkDetector_.
MeanAngleVsHits = trkDir.make<TH2F>(
"h2_meanAngleVsHits",
"<#phi_{module}> vs. # hits;# hits;<#phi_{module}> [ ^{o}]",51,-1,50,50,-5,95);
920 tkDetector_.
HitsGoodVsHitsValid = trkDir.make<TH2F>(
"h2_hitsGoodVsHitsValid",
"# hits [good] vs. # hits [valid];# hits [valid];# hits [good]",51,-1,50,51,-1,50);
921 tkDetector_.
HitsPixelVsEta = trkDir.make<TH2F>(
"h2_hitsPixelVsEta",
"# hits [pixel] vs. #eta;#eta;# hits [pixel]",60,-3,3,11,-1,10);
922 tkDetector_.
HitsPixelVsTheta = trkDir.make<TH2F>(
"h2_hitsPixelVsTheta",
"# hits [pixel] vs. #theta;#theta;# hits [pixel]",100,-10,190,11,-1,10);
923 tkDetector_.
HitsStripVsEta = trkDir.make<TH2F>(
"h2_hitsStripVsEta",
"# hits [strip] vs. #eta;#eta;# hits [strip]",60,-3,3,31,-1,40);
924 tkDetector_.
HitsStripVsTheta = trkDir.make<TH2F>(
"h2_hitsStripVsTheta",
"# hits [strip] vs. #theta;#theta;# hits [strip]",100,-10,190,31,-1,40);
925 tkDetector_.
PtVsEta = trkDir.make<TH2F>(
"h2_ptVsEta",
"p_{t} vs. #eta;#eta;p_{t} [GeV]",60,-3,3,100,0,pMax);
926 tkDetector_.
PtVsTheta = trkDir.make<TH2F>(
"h2_ptVsTheta",
"p_{t} vs. #theta;#theta;p_{t} [GeV]",100,-10,190,100,0,pMax);
928 tkDetector_.
PMeanAngleVsHits = trkDir.make<TProfile>(
"p_meanAngleVsHits",
"<#phi_{module}> vs. # hits;# hits;<#phi_{module}> [ ^{o}]",51,-1,50);
929 tkDetector_.
PHitsGoodVsHitsValid = trkDir.make<TProfile>(
"p_hitsGoodVsHitsValid",
"# hits [good] vs. # hits [valid];# hits [valid];# hits [good]",51,-1,50);
930 tkDetector_.
PHitsPixelVsEta = trkDir.make<TProfile>(
"p_hitsPixelVsEta",
"# hits [pixel] vs. #eta;#eta;# hits [pixel]",60,-3,3);
931 tkDetector_.
PHitsPixelVsTheta = trkDir.make<TProfile>(
"p_hitsPixelVsTheta",
"# hits [pixel] vs. #theta;#theta;# hits [pixel]",100,-10,190);
932 tkDetector_.
PHitsStripVsEta = trkDir.make<TProfile>(
"p_hitsStripVsEta",
"# hits [strip] vs. #eta;#eta;# hits [strip]",60,-3,3);
933 tkDetector_.
PHitsStripVsTheta = trkDir.make<TProfile>(
"p_hitsStripVsTheta",
"# hits [strip] vs. #theta;#theta;# hits [strip]",100,-10,190);
934 tkDetector_.
PPtVsEta = trkDir.make<TProfile>(
"p_ptVsEta",
"p_{t} vs. #eta;#eta;p_{t} [GeV]",60,-3,3);
935 tkDetector_.
PPtVsTheta = trkDir.make<TProfile>(
"p_ptVsTheta",
"p_{t} vs. #theta;#theta;p_{t} [GeV]",100,-10,190);
956 trkParams.hitsValid = track.
found();
957 trkParams.hitsInvalid = trkParams.hitsSize-trkParams.hitsValid;
958 trkParams.layersMissed = track.
lost();
959 trkParams.hitsPixel = hitPattern.numberOfValidPixelHits();
960 trkParams.hitsStrip = hitPattern.numberOfValidStripHits();
961 trkParams.charge = track.
charge();
962 trkParams.chi2 = track.
chi2();
963 trkParams.ndof = track.
ndof();
964 trkParams.norChi2 = trkParams.chi2/trkParams.ndof;
965 trkParams.prob = TMath::Prob(trkParams.chi2,trkParams.ndof);
966 trkParams.eta = track.
eta();
967 trkParams.etaErr = track.
etaError();
968 trkParams.theta = track.
theta();
969 trkParams.phi = track.
phi();
970 trkParams.phiErr = track.
phiError();
971 trkParams.d0 = track.
d0();
972 trkParams.d0Beamspot = -1.*track.
dxy(beamPoint);
973 trkParams.d0BeamspotErr = d0BeamspotErr;
974 trkParams.dz = track.
dz();
975 trkParams.dzErr = track.
dzError();
976 trkParams.dzBeamspot = track.
dz(beamPoint);
977 trkParams.p = track.
p();
978 trkParams.pt = track.
pt();
979 trkParams.ptErr = track.
ptError();
981 const std::vector<TrajectoryMeasurement>& v_meas = traj.
measurements();
983 int count2D(0);
float meanPhiSensToNorm(0.
F);
984 std::vector<TrajectoryMeasurement>::const_iterator i_meas;
985 for(i_meas = v_meas.begin(); i_meas != v_meas.end(); ++i_meas){
989 if(this->
isHit2D(recHit))++count2D;
993 meanPhiSensToNorm += atan(fabs(
sqrt(mom.x()*mom.x()+mom.y()*mom.y())/mom.z()));
995 meanPhiSensToNorm *= (1./
static_cast<float>(trkParams.hitsSize));
997 trkParams.hits2D = count2D;
998 trkParams.meanPhiSensToNorm = meanPhiSensToNorm;
1002 if(trkParams.hitsStrip<11 || trkParams.hits2D<2 || trkParams.hitsPixel<2 ||
1003 trkParams.hitsStrip>35 || trkParams.hitsPixel>7 ||
1004 trkParams.norChi2>5. ||
1005 trkParams.pt<25. || trkParams.pt>150. ||
1032 const uint32_t rawId(detId.rawId());
1034 for(std::map<unsigned int,TrackerSectorStruct>::const_iterator i_sector =
m_tkSector_.begin(); i_sector !=
m_tkSector_.end(); ++i_sector){
1035 for(std::vector<unsigned int>::const_iterator i_rawId = (*i_sector).second.v_rawId.begin();
1036 i_rawId != (*i_sector).second.v_rawId.end(); ++i_rawId){
1037 if(rawId==*i_rawId){hitParams.
v_sector.push_back((*i_sector).first);
break;}
1042 int xMomentum(0), yMomentum(0), zMomentum(0);
1043 xMomentum = mom.x()>0. ? 1 : -1;
1044 yMomentum = mom.y()>0. ? 1 : -1;
1045 zMomentum = mom.z()>0. ? 1 : -1;
1046 float phiSensX = std::atan(std::fabs(mom.x()/mom.z()))*
static_cast<float>(
m_tkTreeVar_[rawId].vDirection);
1047 float phiSensY = std::atan(std::fabs(mom.y()/mom.z()))*
static_cast<float>(
m_tkTreeVar_[rawId].vDirection);
1048 hitParams.
phiSens = std::atan(std::fabs(
std::sqrt(mom.x()*mom.x()+mom.y()*mom.y())/mom.z()));
1049 hitParams.
phiSensX = (xMomentum==zMomentum ? phiSensX : -phiSensX );
1050 hitParams.
phiSensY = (yMomentum==zMomentum ? phiSensY : -phiSensY );
1078 else {
edm::LogWarning(
"FillHitVariables")<<
"cant identify wether hit is from pixel or strip";
1091 { errorWithoutAPE =
LocalError(errHitApe.
xx() -lape.
xx(), errHitApe.
xy()- lape.
xy(), errHitApe.
yy()-lape.
yy());
1100 { errorWithoutAPE =
LocalError(errHitApe.
xx() -lape.
xx(), errHitApe.
xy()- lape.
xy(), errHitApe.
yy()-lape.
yy());
1105 const LocalError& errHitWoApe = errorWithoutAPE;
1110 std::cout<<
"errHitWoApe " <<errHitWoApe<<
"errHitApe "<<errHitApe<<std::endl;
1138 const float xHit = positionAndError2Hit.second.posX;
1139 const float xTrk = positionAndError2Trk.second.posX;
1140 const float yHit = positionAndError2Hit.second.posY;
1141 const float yTrk = positionAndError2Trk.second.posY;
1143 const float errXHit2(positionAndError2Hit.second.errX2);
1144 const float errXHitWoApe2(positionAndError2HitWoApe.second.errX2);
1145 const float errXTrk2(positionAndError2Trk.second.errX2);
1146 const float errYHit2(positionAndError2Hit.second.errY2);
1147 const float errYHitWoApe2(positionAndError2HitWoApe.second.errY2);
1148 const float errYTrk2(positionAndError2Trk.second.errY2);
1150 const float errXHit =
std::sqrt(positionAndError2Hit.second.errX2);
1151 const float errXHitWoApe =
std::sqrt(positionAndError2HitWoApe.second.errX2);
1152 const float errXTrk =
std::sqrt(positionAndError2Trk.second.errX2);
1153 const float errYHit =
std::sqrt(positionAndError2Hit.second.errY2);
1154 const float errYHitWoApe =
std::sqrt(positionAndError2HitWoApe.second.errY2);
1155 const float errYTrk =
std::sqrt(positionAndError2Trk.second.errY2);
1157 const float resX = xTrk - xHit;
1158 const float resY = yTrk - yHit;
1160 const float errX =
std::sqrt(errXHit2 + errXTrk2);
1161 const float errXWoApe2 = errXHitWoApe2 + errXTrk2;
1162 const float errXWoApe =
std::sqrt(errXWoApe2);
1163 const float errY =
std::sqrt(errYHit2 + errYTrk2);
1164 const float errYWoApe2 = errYHitWoApe2 + errYTrk2;
1165 const float errYWoApe =
std::sqrt(errYWoApe2);
1167 const float norResX = resX/errX;
1168 const float norResY = resY/errY;
1173 float resXprime(999.
F), resYprime(999.
F), norResXprime(999.
F), norResYprime(999.
F);
1174 if(
m_tkTreeVar_[rawId].uDirection == 1){resXprime = resX; norResXprime = norResX;}
1175 else if(
m_tkTreeVar_[rawId].uDirection == -1){resXprime = -resX; norResXprime = -norResX;}
1177 if(
m_tkTreeVar_[rawId].vDirection == 1){resYprime = resY; norResYprime = norResY;}
1178 else if(
m_tkTreeVar_[rawId].vDirection == -1){resYprime = -resY; norResYprime = -norResY;}
1181 hitParams.
xHit = xHit;
1182 hitParams.
xTrk = xTrk;
1188 hitParams.
errX2 = errX*errX;
1189 hitParams.
errX = errX;
1192 hitParams.
resX = resXprime;
1193 hitParams.
norResX = norResXprime;
1195 const float norResX2(norResXprime*norResXprime);
1196 hitParams.
probX = TMath::Prob(norResX2,1);
1199 hitParams.
yHit = yHit;
1200 hitParams.
yTrk = yTrk;
1206 hitParams.
errY2 = errY*errY;
1207 hitParams.
errY = errY;
1210 hitParams.
resY = resYprime;
1211 hitParams.
norResY = norResYprime;
1213 const float norResY2(norResYprime*norResYprime);
1214 hitParams.
probY = TMath::Prob(norResY2,1);
1243 if(!(dynamic_cast<const SiStripRecHit2D*>(&recHit) || dynamic_cast<const SiStripRecHit1D*>(&recHit))){
1244 edm::LogError(
"FillHitVariables")<<
"RecHit in Strip is 'Matched' or 'Projected', but here all should be monohits per module";
1249 if(dynamic_cast<const SiStripRecHit1D*>(&recHit)){
1251 clusterPtr = &(*stripHit.
cluster());
1253 else if(dynamic_cast<const SiStripRecHit2D*>(&recHit)){
1254 edm::LogWarning(
"FillHitVariables")<<
"Data has TIB/TOB hits as SiStripRecHit2D and not 1D. Probably data is processed with CMSSW<34X. Nevertheless everything should work fine";
1256 clusterPtr = &(*stripHit.
cluster());
1261 clusterPtr = &(*stripHit.
cluster());
1264 edm::LogError(
"FillHitVariables")<<
"Pointer to cluster not valid!!! This should never happen...";
1271 const std::vector<uint8_t>::const_iterator stripChargeL(clusterInfo.
stripCharges().begin());
1272 const std::vector<uint8_t>::const_iterator stripChargeR(--(clusterInfo.
stripCharges().end()));
1273 const std::pair<uint16_t, uint16_t> stripChargeLR = std::make_pair(*stripChargeL,*stripChargeR);
1283 hitParams.
chargeOnEdges =
static_cast<float>(stripChargeLR.first + stripChargeLR.second)/static_cast<float>(hitParams.
chargeStrip);
1284 hitParams.
chargeAsymmetry =
static_cast<float>(stripChargeLR.first - stripChargeLR.second)/static_cast<float>(stripChargeLR.first + stripChargeLR.second);
1309 float dirX = -tanLorentzAnglePerTesla * bField.y();
1310 float dirY = tanLorentzAnglePerTesla * bField.x();
1325 if(momentumDir.z() > 0.)scaledMomentumDir *= std::fabs(thickness/momentumDir.z());
1326 else if(momentumDir.z() < 0.)scaledMomentumDir *= -std::fabs(thickness/momentumDir.z());
1327 else scaledMomentumDir *= maxLength/momentumDir.mag();
1330 if(projEdge1 < 0.)projEdge1 = 0.;
1333 if(projEdge2 < 0.)projEdge1 = 0.;
1337 float coveredStrips = std::fabs(projEdge2 - projEdge1);
1344 edm::LogError(
"FillHitVariables")<<
"Incorrect subdetector ID, hit not associated to tracker";
1364 const uint32_t& rawId(detId.rawId());
1367 if(localError.
xx()<0. || localError.
yy()<0.){
1384 if(!hit.
detUnit())
return vPE2;
1387 if(!dynamic_cast<const RadialStripTopology*>(&detUnit.
type().
topology()))
return vPE2;
1391 if(measError.
uu()<0. || measError.
vv()<0.){
1407 edm::LogError(
"FillHitVariables")<<
"Incorrect subdetector ID, hit not associated to tracker";
1418 const float x(lP.
x());
1419 const float y(lP.
y());
1420 const float errX2(lE.
xx());
1421 const float errY2(lE.
yy());
1440 float errX2(-999.
F);
1441 float errY2(-999.
F);
1447 y = measPos.
y()*stripLength;
1449 const float l_0 = r_0 - topol.
detHeight()/2;
1451 y = measPos.
y()*stripLength - 0.5*stripLength + l_0*(1./cosPhi - 1.);
1454 const float errPhi2(measErr.
uu()*angularWidth2);
1456 errX2 = errPhi2*r_0*r_0;
1460 errY2 = measErr.
vv()*stripLength*stripLength;
1463 const float helpSummand = l_0*l_0*(sinPhi2/cosPhi4*errPhi2);
1464 errY2 = measErr.
vv()*stripLength*stripLength + helpSummand;
1528 bool emptyMap(
true);
1530 if(0 < (*i_hitSelection).second.size()){
1531 int entry(1);
double intervalBegin(999.);
1532 for(std::vector<double>::iterator i_hitInterval = (*i_hitSelection).second.begin(); i_hitInterval != (*i_hitSelection).second.end(); ++entry){
1533 if(entry%2==1){intervalBegin = *i_hitInterval; ++i_hitInterval;}
1535 if(intervalBegin > *i_hitInterval){
1536 edm::LogError(
"HitSelector")<<
"INVALID Interval selected for "<<(*i_hitSelection).first<<
":\t"<<intervalBegin<<
" > "<<(*i_hitInterval)
1537 <<
"\n ... delete Selection for "<<(*i_hitSelection).first;
1538 (*i_hitSelection).second.clear(); i_hitInterval = (*i_hitSelection).second.begin();
1540 edm::LogInfo(
"HitSelector")<<
"Interval selected for "<<(*i_hitSelection).first<<
":\t"<<intervalBegin<<
", "<<(*i_hitInterval);
1545 if(0 < (*i_hitSelection).second.size())emptyMap =
false;
1550 bool emptyMapUInt(
true);
1552 if(0 < (*i_hitSelection).second.size()){
1553 int entry(1);
unsigned int intervalBegin(999);
1554 for(std::vector<unsigned int>::iterator i_hitInterval = (*i_hitSelection).second.begin(); i_hitInterval != (*i_hitSelection).second.end(); ++entry){
1555 if(entry%2==1){intervalBegin = *i_hitInterval; ++i_hitInterval;}
1557 if(intervalBegin > *i_hitInterval){
1558 edm::LogError(
"HitSelector")<<
"INVALID Interval selected for "<<(*i_hitSelection).first<<
":\t"<<intervalBegin<<
" > "<<(*i_hitInterval)
1559 <<
"\n ... delete Selection for "<<(*i_hitSelection).first;
1560 (*i_hitSelection).second.clear(); i_hitInterval = (*i_hitSelection).second.begin();
1562 edm::LogInfo(
"HitSelector")<<
"Interval selected for "<<(*i_hitSelection).first<<
":\t"<<intervalBegin<<
", "<<(*i_hitInterval);
1567 if(0 < (*i_hitSelection).second.size())emptyMapUInt =
false;
1571 if(emptyMap && emptyMapUInt){
1584 std::vector<double> v_cutVariable(parSet.
getParameter<std::vector<double> >(cutVariable));
1585 if(v_cutVariable.size()%2==1){
1586 edm::LogError(
"HitSelector")<<
"Invalid Hit Selection for "<<cutVariable<<
": need even number of arguments (intervals)"
1587 <<
"\n ... delete Selection for "<<cutVariable;
1588 v_cutVariable.clear();
1600 std::vector<unsigned int> v_cutVariable(parSet.
getParameter<std::vector<unsigned int> >(cutVariable));
1601 if(v_cutVariable.size()%2==1){
1602 edm::LogError(
"HitSelector")<<
"Invalid Hit Selection for "<<cutVariable<<
": need even number of arguments (intervals)"
1603 <<
"\n ... delete Selection for "<<cutVariable;
1604 v_cutVariable.clear();
1621 bool isGoodHit(
true);
1622 bool isGoodHitX(
true);
1623 bool isGoodHitY(
true);
1627 const std::vector<double>& v_hitSelection((*i_hitSelection).second);
1628 if(v_hitSelection.size()==0)
continue;
1631 if (hitSelection ==
"phiSens") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
phiSens))isGoodHit =
false;}
1632 else if(hitSelection ==
"phiSensX") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
phiSensX))isGoodHit =
false;}
1633 else if(hitSelection ==
"phiSensY") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
phiSensY))isGoodHit =
false;}
1635 else if(hitSelection ==
"resX") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
resX))isGoodHitX =
false;}
1636 else if(hitSelection ==
"norResX") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
norResX))isGoodHitX =
false;}
1637 else if(hitSelection ==
"probX") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
probX))isGoodHitX =
false;}
1638 else if(hitSelection ==
"errXHit") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
errXHit))isGoodHitX =
false;}
1639 else if(hitSelection ==
"errXTrk") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
errXTrk))isGoodHitX =
false;}
1640 else if(hitSelection ==
"errX") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
errX))isGoodHitX =
false;}
1641 else if(hitSelection ==
"errX2") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
errX2))isGoodHitX =
false;}
1656 else if(hitSelection ==
"resY") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
resY))isGoodHitY =
false;}
1657 else if(hitSelection ==
"norResY") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
norResY))isGoodHitY =
false;}
1658 else if(hitSelection ==
"probY") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
probY))isGoodHitY =
false;}
1659 else if(hitSelection ==
"errYHit") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
errYHit))isGoodHitY =
false;}
1660 else if(hitSelection ==
"errYTrk") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
errYTrk))isGoodHitY =
false;}
1661 else if(hitSelection ==
"errY") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
errY))isGoodHitY =
false;}
1662 else if(hitSelection ==
"errY2") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
errY2))isGoodHitY =
false;}
1668 else if(hitSelection ==
"widthDiff") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
projWidth-static_cast<float>(hitParams.
widthX)))isGoodHit =
false;}
1670 else if(hitSelection ==
"maxCharge") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
maxCharge))isGoodHit =
false;}
1675 else if(hitSelection ==
"sOverN") {
if(!this->
inDoubleInterval(v_hitSelection, hitParams.
sOverN))isGoodHit =
false;}
1681 const std::vector<unsigned int>& v_hitSelection((*i_hitSelection).second);
1682 if(v_hitSelection.size()==0)
continue;
1688 if(hitSelection ==
"isOnEdge") {
if(!this->
inUintInterval(v_hitSelection, hitParams.
isOnEdge))isGoodHit =
false;}
1690 else if(hitSelection ==
"spansTwoRoc") {
if(!this->
inUintInterval(v_hitSelection, hitParams.
spansTwoRoc))isGoodHit =
false;}
1691 else if(hitSelection ==
"qBin") {
if(!this->
inUintInterval(v_hitSelection, hitParams.
qBin))isGoodHit =
false;}
1693 else if(hitSelection ==
"widthX") {
if(!this->
inUintInterval(v_hitSelection, hitParams.
widthX))isGoodHitX =
false;}
1694 else if(hitSelection ==
"widthY") {
if(!this->
inUintInterval(v_hitSelection, hitParams.
widthY))isGoodHitY =
false;}
1699 if (hitSelection ==
"width") {
if(!this->
inUintInterval(v_hitSelection, hitParams.
widthX))isGoodHit =
false;}
1701 else if(hitSelection ==
"maxIndex") {
if(!this->
inUintInterval(v_hitSelection, hitParams.
maxIndex))isGoodHit =
false;}
1721 int entry(1);
double intervalBegin(999.);
1722 bool isSelected(
false);
1723 for(std::vector<double>::const_iterator i_hitInterval = v_hitSelection.begin(); i_hitInterval != v_hitSelection.end(); ++i_hitInterval, ++entry){
1724 if(entry%2==1)intervalBegin = *i_hitInterval;
1725 else if(variable>=intervalBegin && variable<*i_hitInterval)isSelected =
true;
1733 int entry(1);
unsigned int intervalBegin(999);
1734 bool isSelected(
false);
1735 for(std::vector<unsigned int>::const_iterator i_hitInterval = v_hitSelection.begin(); i_hitInterval != v_hitSelection.end(); ++i_hitInterval, ++entry){
1736 if(entry%2==1)intervalBegin = *i_hitInterval;
1737 else if(variable>=intervalBegin && variable<=*i_hitInterval){
1738 if(variable2==999 || (variable2>=intervalBegin && variable2<=*i_hitInterval))isSelected =
true;
1752 unsigned int goodHitsPerTrack(trackStruct.
v_hitParams.size());
1810 for(std::vector<TrackStruct::HitParameterStruct>::const_iterator i_hit = trackStruct.
v_hitParams.begin();
1816 for(std::map<unsigned int,TrackerSectorStruct>::iterator i_sector =
m_tkSector_.begin(); i_sector !=
m_tkSector_.end(); ++i_sector){
1817 bool moduleInSector(
false);
1818 for(std::vector<unsigned int>::const_iterator i_hitSector = hit.
v_sector.begin(); i_hitSector != hit.
v_sector.end(); ++i_hitSector){
1819 if((*i_sector).first == *i_hitSector){moduleInSector =
true;
break;}
1821 if(!moduleInSector)
continue;
1825 std::map<std::string,TrackerSectorStruct::CorrelationHists>& m_corrHists(sector.
m_correlationHistsX);
1832 m_corrHists[
"HitsGood"].fillCorrHistsX(hit,goodHitsPerTrack);
1834 m_corrHists[
"Hits2D"].fillCorrHistsX(hit,trackStruct.
trkParams.
hits2D);
1840 m_corrHists[
"Phi"].fillCorrHistsX(hit,trackStruct.
trkParams.
phi*180./
M_PI);
1842 m_corrHists[
"Dz"].fillCorrHistsX(hit,trackStruct.
trkParams.
dz);
1843 m_corrHists[
"Pt"].fillCorrHistsX(hit,trackStruct.
trkParams.
pt);
1844 m_corrHists[
"P"].fillCorrHistsX(hit,trackStruct.
trkParams.
p);
1845 m_corrHists[
"InvP"].fillCorrHistsX(hit,1./trackStruct.
trkParams.
p);
1851 std::map<std::string,TrackerSectorStruct::CorrelationHists>& m_corrHists(sector.
m_correlationHistsY);
1858 m_corrHists[
"HitsGood"].fillCorrHistsY(hit,goodHitsPerTrack);
1860 m_corrHists[
"Hits2D"].fillCorrHistsY(hit,trackStruct.
trkParams.
hits2D);
1866 m_corrHists[
"Phi"].fillCorrHistsY(hit,trackStruct.
trkParams.
phi*180./
M_PI);
1868 m_corrHists[
"Dz"].fillCorrHistsY(hit,trackStruct.
trkParams.
dz);
1869 m_corrHists[
"Pt"].fillCorrHistsY(hit,trackStruct.
trkParams.
pt);
1870 m_corrHists[
"P"].fillCorrHistsY(hit,trackStruct.
trkParams.
p);
1871 m_corrHists[
"InvP"].fillCorrHistsY(hit,1./trackStruct.
trkParams.
p);
1877 for(std::vector<TH1*>::iterator iHist = (*i_sigmaX).second.begin(); iHist != (*i_sigmaX).second.end(); ++iHist){
1878 if ((*i_sigmaX).first==
"sigmaXHit")(*iHist)->Fill(hit.
errXHit*10000.);
1879 else if((*i_sigmaX).first==
"sigmaXTrk")(*iHist)->Fill(hit.
errXTrk*10000.);
1880 else if((*i_sigmaX).first==
"sigmaX") (*iHist)->Fill(hit.
errX*10000.);
1884 for(std::vector<TH1*>::iterator iHist = (*i_sigmaY).second.begin(); iHist != (*i_sigmaY).second.end(); ++iHist){
1885 if ((*i_sigmaY).first==
"sigmaYHit")(*iHist)->Fill(hit.
errYHit*10000.);
1886 else if((*i_sigmaY).first==
"sigmaYTrk")(*iHist)->Fill(hit.
errYTrk*10000.);
1887 else if((*i_sigmaY).first==
"sigmaY") (*iHist)->Fill(hit.
errY*10000.);
1898 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(sector.
m_correlationHistsX);
1901 m_corrHists[
"WidthX"].fillCorrHistsX(hit, hit.
widthX);
1902 m_corrHists[
"BaryStripX"].fillCorrHistsX(hit, hit.
baryStripX);
1905 m_corrHists[
"ChargePixel"].fillCorrHistsX(hit, hit.
chargePixel);
1910 m_corrHists[
"IsOnEdge"].fillCorrHistsX(hit, hit.
isOnEdge);
1911 m_corrHists[
"HasBadPixels"].fillCorrHistsX(hit, hit.
hasBadPixels);
1912 m_corrHists[
"SpansTwoRoc"].fillCorrHistsX(hit, hit.
spansTwoRoc);
1913 m_corrHists[
"QBin"].fillCorrHistsX(hit, hit.
qBin);
1917 m_corrHists[
"ChargeStrip"].fillCorrHistsX(hit, hit.
chargeStrip);
1918 m_corrHists[
"MaxStrip"].fillCorrHistsX(hit, hit.
maxStrip);
1919 m_corrHists[
"MaxCharge"].fillCorrHistsX(hit, hit.
maxCharge);
1920 m_corrHists[
"MaxIndex"].fillCorrHistsX(hit, hit.
maxIndex);
1921 m_corrHists[
"ChargeOnEdges"].fillCorrHistsX(hit, hit.
chargeOnEdges);
1922 m_corrHists[
"ChargeAsymmetry"].fillCorrHistsX(hit, hit.
chargeAsymmetry);
1923 m_corrHists[
"ChargeLRplus"].fillCorrHistsX(hit, hit.
chargeLRplus);
1924 m_corrHists[
"ChargeLRminus"].fillCorrHistsX(hit, hit.
chargeLRminus);
1925 m_corrHists[
"SOverN"].fillCorrHistsX(hit, hit.
sOverN);
1926 m_corrHists[
"WidthProj"].fillCorrHistsX(hit, hit.
projWidth);
1927 m_corrHists[
"WidthDiff"].fillCorrHistsX(hit, hit.
projWidth-static_cast<float>( hit.
widthX));
1943 m_corrHists[
"SigmaXHit"].fillCorrHistsX(hit, hit.
errXHit*10000.);
1944 m_corrHists[
"SigmaXTrk"].fillCorrHistsX(hit, hit.
errXTrk*10000.);
1945 m_corrHists[
"SigmaX"].fillCorrHistsX(hit, hit.
errX*10000.);
1947 m_corrHists[
"PhiSens"].fillCorrHistsX(hit, hit.
phiSens*180./
M_PI);
1948 m_corrHists[
"PhiSensX"].fillCorrHistsX(hit, hit.
phiSensX*180./
M_PI);
1949 m_corrHists[
"PhiSensY"].fillCorrHistsX(hit, hit.
phiSensY*180./
M_PI);
1955 sector.
ResX ->Fill(hit.
resX*10000.);
1968 std::map<std::string, TrackerSectorStruct::CorrelationHists>& m_corrHists(sector.
m_correlationHistsY);
1973 m_corrHists[
"WidthY"].fillCorrHistsY(hit,hit.
widthY);
1974 m_corrHists[
"BaryStripY"].fillCorrHistsY(hit,hit.
baryStripY);
1976 m_corrHists[
"ChargePixel"].fillCorrHistsY(hit, hit.
chargePixel);
1981 m_corrHists[
"IsOnEdge"].fillCorrHistsY(hit, hit.
isOnEdge);
1982 m_corrHists[
"HasBadPixels"].fillCorrHistsY(hit, hit.
hasBadPixels);
1983 m_corrHists[
"SpansTwoRoc"].fillCorrHistsY(hit, hit.
spansTwoRoc);
1984 m_corrHists[
"QBin"].fillCorrHistsY(hit, hit.
qBin);
1987 m_corrHists[
"SigmaYHit"].fillCorrHistsY(hit, hit.
errYHit*10000.);
1988 m_corrHists[
"SigmaYTrk"].fillCorrHistsY(hit, hit.
errYTrk*10000.);
1989 m_corrHists[
"SigmaY"].fillCorrHistsY(hit, hit.
errY*10000.);
1991 m_corrHists[
"PhiSens"].fillCorrHistsY(hit, hit.
phiSens*180./
M_PI);
1992 m_corrHists[
"PhiSensX"].fillCorrHistsY(hit, hit.
phiSensX*180./
M_PI);
1993 m_corrHists[
"PhiSensY"].fillCorrHistsY(hit, hit.
phiSensY*180./
M_PI);
1999 sector.
ResY ->Fill(hit.
resY*10000.);
2013 unsigned int goodHitsPerTrack(trackStruct.
v_hitParams.size());
2020 for(std::vector<TrackStruct::HitParameterStruct>::const_iterator i_hit = trackStruct.
v_hitParams.begin();
2025 for(std::map<unsigned int,TrackerSectorStruct>::iterator i_sector =
m_tkSector_.begin(); i_sector !=
m_tkSector_.end(); ++i_sector){
2027 bool moduleInSector(
false);
2028 for(std::vector<unsigned int>::const_iterator i_hitSector = (*i_hit).v_sector.begin(); i_hitSector != (*i_hit).v_sector.end(); ++i_hitSector){
2029 if((*i_sector).first == *i_hitSector){moduleInSector =
true;
break;}
2031 if(!moduleInSector)
continue;
2035 if((*i_hit).goodXMeasurement){
2036 for(
std::map<
unsigned int,std::pair<double,double> >::const_iterator i_errBins =
m_resErrBins_.begin();
2041 if((*i_hit).errXWoApe < (*i_errBins).second.first || (*i_hit).errXWoApe >= (*i_errBins).second.second){
2044 (*i_sector).second.m_binnedHists[(*i_errBins).first][
"sigmaX"] ->Fill((*i_hit).errXWoApe);
2045 (*i_sector).second.m_binnedHists[(*i_errBins).first][
"norResX"]->Fill((*i_hit).norResX);
2048 (*i_sector).second.ResX->Fill((*i_hit).resX*10000.);
2049 (*i_sector).second.NorResX->Fill((*i_hit).norResX);
2052 if((*i_hit).goodYMeasurement){
2053 for(
std::map<
unsigned int,std::pair<double,double> >::const_iterator i_errBins =
m_resErrBins_.begin();
2058 if((*i_hit).errYWoApe < (*i_errBins).second.first || (*i_hit).errYWoApe >= (*i_errBins).second.second){
2061 (*i_sector).second.m_binnedHists[(*i_errBins).first][
"sigmaY"] ->Fill((*i_hit).errYWoApe);
2062 (*i_sector).second.m_binnedHists[(*i_errBins).first][
"norResY"]->Fill((*i_hit).norResY);
2065 (*i_sector).second.ResY->Fill((*i_hit).resY*10000.);
2066 (*i_sector).second.NorResY->Fill((*i_hit).norResY);
2082 for(std::map<unsigned int,TrackerSectorStruct>::iterator i_sector =
m_tkSector_.begin(); i_sector !=
m_tkSector_.end(); ++i_sector){
2085 for(
std::map<
unsigned int, std::map<std::string,TH1*> >::const_iterator i_errBins = (*i_sector).second.m_binnedHists.begin();
2086 i_errBins != (*i_sector).second.m_binnedHists.end(); ++i_errBins){
2087 std::map<std::string,TH1*> m_Hists = (*i_errBins).second;
2090 double integralX = m_Hists[
"norResX"]->Integral();
2091 (*i_sector).second.EntriesX->SetBinContent((*i_errBins).first, integralX);
2093 if((*i_sector).second.isPixel){
2094 double integralY = m_Hists[
"norResY"]->Integral();
2095 (*i_sector).second.EntriesY->SetBinContent((*i_errBins).first, integralY);
2123 if (stripId.
stereo())
return true;
2124 else if (dynamic_cast<const SiStripRecHit1D*>(&hit)
2127 else if (dynamic_cast<const SiStripMatchedRecHit2D*>(&hit))
return true;
2128 else if (dynamic_cast<const ProjectedSiStripRecHit2D*>(&hit)) {
2132 edm::LogError(
"UnkownType") <<
"@SUB=AlignmentTrackSelector::isHit2D"
2133 <<
"Tracker hit not in pixel, neither SiStripRecHit[12]D nor "
2134 <<
"SiStripMatchedRecHit2D nor ProjectedSiStripRecHit2D.";
2139 edm::LogWarning(
"DetectorMismatch") <<
"@SUB=AlignmentTrackSelector::isHit2D"
2140 <<
"Hit not in tracker with 'official' dimension >=2.";
2160 if (beamSpotHandle.
isValid()){
2161 beamSpot = *beamSpotHandle;
2165 edm::LogError(
"ApeEstimator")<<
"No beam spot available from EventSetup"
2166 <<
"\n...skip event";
2179 typedef std::vector<ConstTrajTrackPair> ConstTrajTrackPairCollection;
2180 ConstTrajTrackPairCollection trajTracks;
2183 for(i_trajTrack = m_TrajTracksMap->begin();i_trajTrack != m_TrajTracksMap->end();++i_trajTrack){
2184 trajTracks.push_back(
ConstTrajTrackPair(&(*(*i_trajTrack).key), &(*(*i_trajTrack).val)));
2189 unsigned int trackSizeGood(0);
2190 ConstTrajTrackPairCollection::const_iterator iTrack;
2191 for(iTrack = trajTracks.begin(); iTrack != trajTracks.end();++iTrack){
2201 const std::vector<TrajectoryMeasurement> v_meas = (*traj).measurements();
2204 for(std::vector<TrajectoryMeasurement>::const_iterator i_meas = v_meas.begin(); i_meas != v_meas.end(); ++i_meas){
2212 if(trackStruct.
v_hitParams.size()>0)++trackSizeGood;
ClusterRef cluster() const
uint8_t maxCharge() const
double p() const
momentum vector magnitude
bool inDoubleInterval(const std::vector< double > &, const float) const
T getParameter(std::string const &) const
double z0() const
z coordinate
std::vector< unsigned int > v_sector
virtual int dimension() const =0
const edm::ParameterSet parameterSet_
double d0Error() const
error on d0
TProfile * PHitsPixelVsTheta
unsigned short lost() const
Number of lost (=invalid) hits on track.
float clusterProbability(unsigned int flags=0) const
float logClusterProbability
virtual float length() const =0
ConstRecHitPointer const & recHit() const
virtual float localStripLength(const LocalPoint &) const =0
void bookSectorHistsForAnalyzerMode()
float clusterProbabilityXYQ
double d0() const
dxy parameter in perigee convention (d0 = -dxy)
virtual const GeomDetType & type() const
TProfile * PHitsStripVsEta
friend struct const_iterator
bool getByToken(EDGetToken token, Handle< PROD > &result) const
std::pair< uint16_t, uint16_t > chargeLR() const
double theta() const
polar angle
#define DEFINE_FWK_MODULE(type)
size_t recHitsSize() const
Get number of RecHits. (Warning, this includes invalid hits, which are not physical hits)...
std::map< std::string, std::vector< TH1 * > > m_sigmaY
LocalVector localDirection() const
LocalPoint localPosition() const
ApeEstimator(const edm::ParameterSet &)
TH2 * WidthDiffVsMaxStrip
Sin< T >::type sin(const T &t)
std::map< std::string, std::vector< TH1 * > > m_sigmaX
TProfile * PMeanAngleVsHits
double etaError() const
error on eta
TH2 * WidthDiffVsSigmaXHit
double phi() const
azimuthal angle of momentum vector
const Bounds & bounds() const
PositionAndError2 radialPositionAndError2(const LocalPoint &, const LocalError &, const RadialStripTopology &)
void fillHitHistsYForAnalyzerMode(const TrackStruct::HitParameterStruct &, TrackerSectorStruct &)
LocalVector toLocal(const reco::Track::Vector &v, const Surface &s)
uint16_t maxIndex() const
virtual float detHeight() const =0
PositionAndError2 rectangularPositionAndError2(const LocalPoint &, const LocalError &)
TrackerDetectorStruct tkDetector_
const Plane & surface() const
The nominal surface of the GeomDet.
LocalError positionError() const
const unsigned int maxTracksPerEvent_
bool hasBadPixels() const
TrackStruct::HitParameterStruct fillHitVariables(const TrajectoryMeasurement &, const edm::EventSetup &)
std::map< unsigned int, std::pair< double, double > > m_resErrBins_
std::pair< TrackStruct::HitState, PositionAndError2 > StatePositionAndError2
TProfile * PPhiSensYVsBarycentreY
auto stripCharges() const -> decltype(cluster() ->amplitudes())
void residualErrorBinning()
uint32_t rawId() const
get the raw id
virtual float thickness() const =0
DataContainer const & measurements() const
TProfile * PWidthDiffVsMaxStrip
float signalOverNoise() const
float getLorentzAngle(const uint32_t &) const
TProfile * PPhiSensXVsBarycentreX
virtual MeasurementError measurementError(const LocalPoint &, const LocalError &) const =0
double eta() const
pseudorapidity of momentum vector
std::vector< HitParameterStruct > v_hitParams
double chi2() const
chi-squared of the fit
void statistics(const TrackerSectorStruct &, const Int_t) const
double ndof() const
number of degrees of freedom of the fit
bool isHit2D(const TrackingRecHit &) const
float clusterProbabilityXY
TrackStruct::TrackParameterStruct fillTrackVariables(const reco::Track &, const Trajectory &, const reco::BeamSpot &)
double pt() const
track transverse momentum
TProfile * PHitsStripVsTheta
TrackParameterStruct trkParams
Cos< T >::type cos(const T &t)
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
edm::EDGetTokenT< reco::BeamSpot > offlinebeamSpot_
double phiError() const
error on phi
Abs< T >::type abs(const T &t)
TProfile * PHitsGoodVsHitsValid
DetId geographicalId() const
The label of this GeomDet.
double BeamWidthX() const
beam width X
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
bool hitSelected(TrackStruct::HitParameterStruct &) const
ClusterRef cluster() const
virtual float angularWidth() const =0
virtual MeasurementPoint measurementPosition(const LocalPoint &) const =0
bool checkModulePositions(const float, const std::vector< double > &) const
T * make(const Args &...args) const
make new ROOT object
const LocalTrajectoryError & localError() const
TH2 * HitsGoodVsHitsValid
bool checkModuleBools(const bool, const std::vector< unsigned int > &) const
bool checkModuleIds(const unsigned int, const std::vector< unsigned int > &) const
std::map< unsigned int, TrackerSectorStruct > m_tkSector_
std::map< std::string, std::vector< unsigned int > > m_hitSelectionUInt_
TProfile * PWidthVsWidthProjected
bool checkIntervalsForSectors(const unsigned int sectorCounter, const std::vector< double > &) const
TrajectoryStateOnSurface const & forwardPredictedState() const
Access to forward predicted state (from fitter or builder)
std::pair< const Trajectory *, const reco::Track * > ConstTrajTrackPair
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
double dzError() const
error on dz
SiStripRecHit2D originalHit() const
Detector identifier class for the strip tracker.
virtual float stripAngle(float strip) const =0
virtual TrackingRecHit const * hit() const
virtual void analyze(const edm::Event &, const edm::EventSetup &)
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
TH2 * PhiSensXVsBarycentreX
uint16_t maxStrip() const
std::map< std::string, CorrelationHists > m_correlationHistsX
edm::Service< TFileService > fileService
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
virtual LocalError localPositionError() const =0
XYZPointD XYZPoint
point in space with cartesian internal representation
bool checkModuleDirections(const int, const std::vector< int > &) const
float clusterProbabilityQ
ClusterRef cluster() const
T const * product() const
double BeamWidthY() const
beam width Y
virtual float originToIntersection() const =0
bool inUintInterval(const std::vector< unsigned int > &, const unsigned int, const unsigned int=999) const
virtual const Topology & topology() const =0
bool IsModuleUsable() const
std::map< unsigned int, ReducedTrackerTreeVariables > m_tkTreeVar_
Pixel cluster – collection of neighboring pixels above threshold.
virtual const GeomDetUnit * detUnit() const
void fillHistsForApeCalculation(const TrackStruct &)
unsigned short found() const
Number of valid hits on track.
bool isPixel(HitType hitType)
bool spansTwoROCs() const
double y0() const
y coordinate
const unsigned int minGoodHitsPerTrack_
void setHitSelectionMap(const std::string &)
edm::EDGetTokenT< TrajTrackAssociationCollection > tjTagToken_
int charge() const
track electric charge
void fillHitHistsXForAnalyzerMode(const TrackStruct::HitParameterStruct &, TrackerSectorStruct &)
DetId geographicalId() const
volatile std::atomic< bool > shutdown_flag false
void fillHistsForAnalyzerMode(const TrackStruct &)
void bookSectorHistsForApeCalculation()
std::map< std::string, CorrelationHists > m_correlationHistsY
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
TH2 * WidthVsWidthProjected
TProfile * PHitsPixelVsEta
Detector det() const
get the detector field from this detid
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
TProfile * PWidthDiffVsSigmaXHit
std::map< std::string, std::vector< double > > m_hitSelection_
virtual LocalPoint localPosition() const =0
virtual float width() const =0
TH2 * PhiSensYVsBarycentreY
const PositionType & position() const
TProfile * PWidthVsPhiSensX
void setHitSelectionMapUInt(const std::string &)
LocalError const & localAlignmentError() const
Return local alligment error.
Power< A, B >::type pow(const A &a, const B &b)
std::vector< unsigned int > v_rawId
const Plane & specificSurface() const
Same as surface(), kept for backward compatibility.
TrajectoryStateOnSurface const & backwardPredictedState() const
Access to backward predicted state (from smoother)
double x0() const
x coordinate
StatePositionAndError2 positionAndError2(const LocalPoint &, const LocalError &, const TransientTrackingRecHit &)