CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
TrackerOfflineValidationSummary Class Reference

#include <Alignment/TrackerOfflineValidationSummary/src/TrackerOfflineValidationSummary.cc>

Inheritance diagram for TrackerOfflineValidationSummary:
edm::EDAnalyzer

Classes

struct  HarvestingHierarchy
 
struct  HarvestingHistos
 Put here the histograms created during harvesting. More...
 
struct  ModuleHistos
 

Public Member Functions

 TrackerOfflineValidationSummary (const edm::ParameterSet &)
 
 ~TrackerOfflineValidationSummary ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Member Functions

virtual void analyze (const edm::Event &evt, const edm::EventSetup &)
 
void applyHarvestingHierarchy (TTree &treeMem)
 
const std::string associateModuleHistsWithTree (const TkOffTreeVariables &treeMem, TrackerOfflineValidationSummary::ModuleHistos &moduleHists, std::map< std::string, std::string > &substructureName)
 
void bookHarvestingHists ()
 
void collateHarvestingHists (TTree &tree)
 
virtual void endJob ()
 
void fillHarvestingHists (TTree &tree)
 
void fillTree (TTree &tree, std::map< int, TrackerOfflineValidationSummary::ModuleHistos > &moduleHist, TkOffTreeVariables &treeMem, const TrackerGeometry &tkgeom, std::map< std::string, std::string > &substructureName)
 
std::pair< float, float > fitResiduals (TH1 *hist) const
 
void getBinning (const std::string &binningPSetName, int &nBinsX, double &lowerBoundX, double &upperBoundX) const
 
float getMedian (const TH1 *hist) const
 

Private Attributes

DQMStoredbe_
 
const std::string moduleDirectory_
 
bool moduleMapsInitialized
 
std::map< int,
TrackerOfflineValidationSummary::ModuleHistos
mPxbResiduals_
 
std::map< int,
TrackerOfflineValidationSummary::ModuleHistos
mPxeResiduals_
 
std::map< int,
TrackerOfflineValidationSummary::ModuleHistos
mTecResiduals_
 
std::map< int,
TrackerOfflineValidationSummary::ModuleHistos
mTibResiduals_
 
std::map< int,
TrackerOfflineValidationSummary::ModuleHistos
mTidResiduals_
 
std::map< int,
TrackerOfflineValidationSummary::ModuleHistos
mTobResiduals_
 
const edm::ParameterSet parSet_
 
edm::ESHandle< TrackerGeometrytkGeom_
 
const bool useFit_
 
std::vector< HarvestingHierarchyvHarvestingHierarchy_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 66 of file TrackerOfflineValidationSummary.cc.

Constructor & Destructor Documentation

TrackerOfflineValidationSummary::TrackerOfflineValidationSummary ( const edm::ParameterSet iConfig)
explicit

Definition at line 155 of file TrackerOfflineValidationSummary.cc.

References dbe_, and cppFunctionSkipper::operator.

155  :
156  parSet_(iConfig), moduleDirectory_(parSet_.getParameter<std::string>("moduleDirectoryInOutput")),
157  useFit_(parSet_.getParameter<bool>("useFit")), dbe_(0), moduleMapsInitialized(false)
158 {
159  //now do what ever initialization is needed
161 }
T getParameter(std::string const &) const
TrackerOfflineValidationSummary::~TrackerOfflineValidationSummary ( )

Definition at line 164 of file TrackerOfflineValidationSummary.cc.

165 {
166 
167  // do anything here that needs to be done at desctruction time
168  // (e.g. close files, deallocate resources etc.)
169 
170 }

Member Function Documentation

void TrackerOfflineValidationSummary::analyze ( const edm::Event evt,
const edm::EventSetup iSetup 
)
privatevirtual

Implements edm::EDAnalyzer.

Definition at line 179 of file TrackerOfflineValidationSummary.cc.

References DetId::det(), TrackerGeometry::detIds(), edm::hlt::Exception, edm::EventSetup::get(), moduleMapsInitialized, mPxbResiduals_, mPxeResiduals_, mTecResiduals_, mTibResiduals_, mTidResiduals_, mTobResiduals_, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), DetId::subdetId(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, tkGeom_, and StripSubdetector::TOB.

180 {
181  // Access of EventSetup is needed to get the list of silicon-modules and their IDs
182  // Since they do not change, it is accessed only once
183  if(moduleMapsInitialized)return;
184  iSetup.get<TrackerDigiGeometryRecord>().get( tkGeom_ );
185  const TrackerGeometry* bareTkGeomPtr = &(*tkGeom_);
186  const TrackingGeometry::DetIdContainer& detIdContainer = bareTkGeomPtr->detIds();
187  std::vector<DetId>::const_iterator iDet;
188  for(iDet = detIdContainer.begin(); iDet != detIdContainer.end(); ++iDet){
189  const DetId& detId = *iDet;
190  const uint32_t rawId = detId.rawId();
191  const unsigned int subdetId = detId.subdetId();
192  if (subdetId == PixelSubdetector::PixelBarrel) mPxbResiduals_[rawId];
193  else if(subdetId == PixelSubdetector::PixelEndcap) mPxeResiduals_[rawId];
194  else if(subdetId == StripSubdetector::TIB) mTibResiduals_[rawId];
195  else if(subdetId == StripSubdetector::TID) mTidResiduals_[rawId];
196  else if(subdetId == StripSubdetector::TOB) mTobResiduals_[rawId];
197  else if(subdetId == StripSubdetector::TEC) mTecResiduals_[rawId];
198  else {
199  throw cms::Exception("Geometry Error")
200  << "[TrackerOfflineValidationSummary] Error, tried to get reference for non-tracker subdet " << subdetId
201  << " from detector " << detId.det();
202  }
203  }
204  moduleMapsInitialized = true;
205 }
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mPxbResiduals_
edm::ESHandle< TrackerGeometry > tkGeom_
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
virtual const DetIdContainer & detIds() const
Returm a vector of all GeomDet DetIds (including those of GeomDetUnits)
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mTibResiduals_
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mTobResiduals_
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mPxeResiduals_
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mTidResiduals_
Definition: DetId.h:20
const T & get() const
Definition: EventSetup.h:55
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mTecResiduals_
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
std::vector< DetId > DetIdContainer
void TrackerOfflineValidationSummary::applyHarvestingHierarchy ( TTree &  treeMem)
private

Definition at line 660 of file TrackerOfflineValidationSummary.cc.

References bookHarvestingHists(), TkOffTreeVariables::isDoubleSide, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TkOffTreeVariables::side, TkOffTreeVariables::subDetId, StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, and vHarvestingHierarchy_.

Referenced by collateHarvestingHists().

661 {
662  TkOffTreeVariables *treeMemPtr = 0;
663  std::map<std::string,std::string> *substructureName = 0;
664  tree.SetBranchAddress("TkOffTreeVariables", &treeMemPtr);
665  tree.SetBranchAddress("SubstructureName", &substructureName);
666 
667  // Loop over modules to select accumulation criteria for harvesting plots
668  for(unsigned int iSubdet = 1; iSubdet<7; ++iSubdet){
669  std::string hierarchyName("");
670  std::string componentName("");
671  std::vector<unsigned int> treeEntries;
672  for(unsigned int iSide = 1; iSide<3; ++iSide){
673  // Set up only one collection for Barrels, not separated for side
674  if(iSide==1 && (iSubdet==PixelSubdetector::PixelBarrel || iSubdet==StripSubdetector::TIB || iSubdet==StripSubdetector::TOB))continue;
675  for(int iTree=0; iTree<tree.GetEntries(); ++iTree){
676  tree.GetEntry(iTree);
677  // Do not use glued Dets
678  if(treeMemPtr->isDoubleSide)continue;
679  if(treeMemPtr->subDetId == iSubdet){
680  if(iSide!=treeMemPtr->side && (iSubdet==PixelSubdetector::PixelEndcap || iSubdet==StripSubdetector::TID || iSubdet==StripSubdetector::TEC))continue;
681  treeEntries.push_back(iTree);
682  if(hierarchyName.length() == 0){
683  hierarchyName = (*substructureName)["subdet"];
684  componentName = (*substructureName)["component"];
685  }
686  }
687  }
688  HarvestingHierarchy harvestingHierarchy(hierarchyName,componentName,treeEntries);
689  vHarvestingHierarchy_.push_back(harvestingHierarchy);
690  hierarchyName = ""; componentName = ""; treeEntries.clear();
691  }
692  }
693  // Here could be a further separation of the HarvestingHierarchy.
694  // E.g. separate the existing ones by layer and add them to the vector without deleting any element from the vector.
695  // The existing hists will stay and the new ones are added
696 
697  // Now, book the corresponding histos
698  this->bookHarvestingHists();
699 }
container to hold data to be written into TTree
std::vector< HarvestingHierarchy > vHarvestingHierarchy_
const std::string TrackerOfflineValidationSummary::associateModuleHistsWithTree ( const TkOffTreeVariables treeMem,
TrackerOfflineValidationSummary::ModuleHistos moduleHists,
std::map< std::string, std::string > &  substructureName 
)
private

Definition at line 465 of file TrackerOfflineValidationSummary.cc.

References TkOffTreeVariables::blade, dbe_, DQMStore::get(), MonitorElement::getTH1(), TkOffTreeVariables::half, TkOffTreeVariables::isDoubleSide, TkOffTreeVariables::layer, TkOffTreeVariables::module, moduleDirectory_, TkOffTreeVariables::moduleId, TrackerOfflineValidationSummary::ModuleHistos::NormResHisto, TrackerOfflineValidationSummary::ModuleHistos::NormResXprimeHisto, TrackerOfflineValidationSummary::ModuleHistos::NormResYprimeHisto, TkOffTreeVariables::outerInner, TkOffTreeVariables::panel, TkOffTreeVariables::petal, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TrackerOfflineValidationSummary::ModuleHistos::ResHisto, TrackerOfflineValidationSummary::ModuleHistos::ResXprimeHisto, TrackerOfflineValidationSummary::ModuleHistos::ResYprimeHisto, relativeConstraints::ring, TkOffTreeVariables::ring, TkOffTreeVariables::rod, TkOffTreeVariables::side, TkOffTreeVariables::subDetId, StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

Referenced by fillTree().

465  {
466  std::stringstream histDir, sSubdetName;
467  std::string componentName;
468  if(moduleDirectory_.length() != 0)histDir<<moduleDirectory_<<"/";
469  std::string wheelOrLayer("_layer_");
471  unsigned int half(treeMem.half), layer(treeMem.layer), ladder(0);
472  if(layer==1){
473  if(half==2)ladder = treeMem.rod -5;
474  else if(treeMem.rod>15)ladder = treeMem.rod -10;
475  else ladder = treeMem.rod;
476  }else if(layer==2){
477  if(half==2)ladder = treeMem.rod -8;
478  else if(treeMem.rod>24)ladder = treeMem.rod -16;
479  else ladder = treeMem.rod;
480  }else if(layer==3){
481  if(half==2)ladder = treeMem.rod -11;
482  else if(treeMem.rod>33)ladder = treeMem.rod -22;
483  else ladder = treeMem.rod;
484  }
485  componentName = "Pixel";
486  sSubdetName<<"TPBBarrel_1";
487  histDir<<componentName<<"/"<<sSubdetName.str()<<"/TPBHalfBarrel_"<<treeMem.half<<"/TPBLayer_"<<treeMem.layer<<"/TPBLadder_"<<ladder;
488  }else if(treeMem.subDetId == PixelSubdetector::PixelEndcap){
489  unsigned int side(treeMem.side), half(treeMem.half), blade(0);
490  if(side==1)side=3;
491  if(half==2)blade = treeMem.blade -6;
492  else if(treeMem.blade>18)blade = treeMem.blade -12;
493  else blade = treeMem.blade;
494  componentName = "Pixel";
495  sSubdetName<<"TPEEndcap_"<<side;
496  histDir<<componentName<<"/"<<sSubdetName.str()<<"/TPEHalfCylinder_"<<treeMem.half<<"/TPEHalfDisk_"<<treeMem.layer<<"/TPEBlade_"<<blade<<"/TPEPanel_"<<treeMem.panel;
497  wheelOrLayer = "_wheel_";
498  }else if(treeMem.subDetId == StripSubdetector::TIB){
499  unsigned int half(treeMem.half), layer(treeMem.layer), surface(treeMem.outerInner), string(0);
500  if(half==2){
501  if(layer==1){
502  if(surface==1)string = treeMem.rod -13;
503  else if(surface==2)string = treeMem.rod -15;
504  }
505  if(layer==2){
506  if(surface==1)string = treeMem.rod -17;
507  else if(surface==2)string = treeMem.rod -19;
508  }
509  if(layer==3){
510  if(surface==1)string = treeMem.rod -22;
511  else if(surface==2)string = treeMem.rod -23;
512  }
513  if(layer==4){
514  if(surface==1)string = treeMem.rod -26;
515  else if(surface==2)string = treeMem.rod -28;
516  }
517  }
518  else string = treeMem.rod;
519  std::stringstream detString;
520  if(treeMem.layer<3 && !treeMem.isDoubleSide)detString<<"/Det_"<<treeMem.module;
521  else detString<<"";
522  componentName = "Strip";
523  sSubdetName<<"TIBBarrel_1";
524  histDir<<componentName<<"/"<<sSubdetName.str()<<"/TIBHalfBarrel_"<<treeMem.side<<"/TIBLayer_"<<treeMem.layer<<"/TIBHalfShell_"<<treeMem.half<<"/TIBSurface_"<<treeMem.outerInner<<"/TIBString_"<<string<<detString.str();
525  }else if(treeMem.subDetId == StripSubdetector::TID){
526  unsigned int side(treeMem.side), outerInner(0);
527  if(side==1)side=3;
528  if(treeMem.outerInner==1)outerInner=2;
529  else if(treeMem.outerInner==2)outerInner=1;
530  std::stringstream detString;
531  if(treeMem.ring<3 && !treeMem.isDoubleSide)detString<<"/Det_"<<treeMem.module;
532  else detString<<"";
533  componentName = "Strip";
534  sSubdetName<<"TIDEndcap_"<<side;
535  histDir<<componentName<<"/"<<sSubdetName.str()<<"/TIDDisk_"<<treeMem.layer<<"/TIDRing_"<<treeMem.ring<<"/TIDSide_"<<outerInner<<detString.str();
536  wheelOrLayer = "_wheel_";
537  }else if(treeMem.subDetId == StripSubdetector::TOB){
538  std::stringstream detString;
539  if(treeMem.layer<3 && !treeMem.isDoubleSide)detString<<"/Det_"<<treeMem.module;
540  else detString<<"";
541  componentName = "Strip";
542  sSubdetName<<"TOBBarrel_4";
543  histDir<<componentName<<"/"<<sSubdetName.str()<<"/TOBHalfBarrel_"<<treeMem.side<<"/TOBLayer_"<<treeMem.layer<<"/TOBRod_"<<treeMem.rod<<detString.str();
544  }else if(treeMem.subDetId == StripSubdetector::TEC) {
545  unsigned int side(0), outerInner(0), ring(0);
546  if(treeMem.side==1)side=6;
547  else if(treeMem.side==2)side=5;
548  if(treeMem.outerInner==1)outerInner = 2;
549  else if(treeMem.outerInner==2)outerInner=1;
550  if(treeMem.layer>3 && treeMem.layer<7)ring = treeMem.ring -1;
551  else if(treeMem.layer==7 || treeMem.layer==8)ring = treeMem.ring -2;
552  else if(treeMem.layer==9)ring = treeMem.ring -3;
553  else ring = treeMem.ring;
554  std::stringstream detString;
555  if((treeMem.ring<3 || treeMem.ring==5) && !treeMem.isDoubleSide)detString<<"/Det_"<<treeMem.module;
556  else detString<<"";
557  componentName = "Strip";
558  sSubdetName<<"TECEndcap_"<<side;
559  histDir<<componentName<<"/"<<sSubdetName.str()<<"/TECDisk_"<<treeMem.layer<<"/TECSide_"<<outerInner<<"/TECPetal_"<<treeMem.petal<<"/TECRing_"<<ring<<detString.str();
560  wheelOrLayer = "_wheel_";
561  }
562 
563  substructureName["component"] = componentName;
564  substructureName["subdet"] = sSubdetName.str();
565 
566  std::stringstream histName;
567  histName<<"residuals_subdet_"<<treeMem.subDetId<<wheelOrLayer<<treeMem.layer<<"_module_"<<treeMem.moduleId;
568 
569  std::string fullPath;
570  fullPath = histDir.str()+"/h_xprime_"+histName.str();
571  if(dbe_->get(fullPath)) moduleHists.ResXprimeHisto = dbe_->get(fullPath)->getTH1();
572  else{edm::LogError("TrackerOfflineValidationSummary")<<"Problem with names in input file produced in TrackerOfflineValidation ...\n"
573  <<"This histogram should exist in every configuration, "
574  <<"but no histogram with name "<<fullPath<<" is found!";
575  return "";
576  }
577  fullPath = histDir.str()+"/h_normxprime"+histName.str();
578  if(dbe_->get(fullPath)) moduleHists.NormResXprimeHisto = dbe_->get(fullPath)->getTH1();
579  fullPath = histDir.str()+"/h_yprime_"+histName.str();
580  if(dbe_->get(fullPath)) moduleHists.ResYprimeHisto = dbe_->get(fullPath)->getTH1();
581  fullPath = histDir.str()+"/h_normyprime"+histName.str();
582  if(dbe_->get(fullPath)) moduleHists.NormResYprimeHisto = dbe_->get(fullPath)->getTH1();
583  fullPath = histDir.str()+"/h_"+histName.str();
584  if(dbe_->get(fullPath)) moduleHists.ResHisto = dbe_->get(fullPath)->getTH1();
585  fullPath = histDir.str()+"/h_norm"+histName.str();
586  if(dbe_->get(fullPath)) moduleHists.NormResHisto = dbe_->get(fullPath)->getTH1();
587 
588  return histDir.str();
589 }
TH1 * getTH1(void) const
MonitorElement * get(const std::string &path) const
get ME from full pathname (e.g. &quot;my/long/dir/my_histo&quot;)
Definition: DQMStore.cc:1468
void TrackerOfflineValidationSummary::bookHarvestingHists ( )
private

Definition at line 703 of file TrackerOfflineValidationSummary.cc.

References DQMStore::book1D(), dbe_, getBinning(), edm::ParameterSet::getParameter(), moduleDirectory_, parSet_, DQMStore::setCurrentFolder(), and vHarvestingHierarchy_.

Referenced by applyHarvestingHierarchy().

704 {
705  edm::LogInfo("TrackerOfflineValidationSummary")<<"Harvesting histograms will be booked for "<<vHarvestingHierarchy_.size()<<" different hierarchy selections";
706  for(std::vector<HarvestingHierarchy>::iterator iHier = vHarvestingHierarchy_.begin(); iHier != vHarvestingHierarchy_.end(); ++iHier){
707 
708  std::stringstream dmrXprimeHistoName, dmrYprimeHistoName, dmrXprimeHistoTitle, dmrYprimeHistoTitle;
709  dmrXprimeHistoName << "h_DmrXprime_" << iHier->hierarchyName;
710  dmrYprimeHistoName << "h_DmrYprime_" << iHier->hierarchyName;
711  dmrXprimeHistoTitle<< "DMR for " << iHier->hierarchyName <<";<#DeltaX> [cm];# modules";
712  dmrYprimeHistoTitle<< "DMR for " << iHier->hierarchyName <<";<#DeltaY> [cm];# modules";
713 
714  std::string directoryString(moduleDirectory_);
715  if(directoryString.length()!=0)directoryString += "/";
716  directoryString += iHier->componentName;
717  dbe_->setCurrentFolder(directoryString);
718 
719  int nBinsX(0); double xMin(0.), xMax(0.);
720  if(iHier->componentName == "Pixel"){
721  this->getBinning("TH1DmrXprimePixelModules",nBinsX,xMin,xMax);
722  iHier->harvestingHistos.DmrXprime = dbe_->book1D(dmrXprimeHistoName.str(),dmrXprimeHistoTitle.str(),nBinsX,xMin,xMax)->getTH1();
723  this->getBinning("TH1DmrYprimePixelModules",nBinsX,xMin,xMax);
724  iHier->harvestingHistos.DmrYprime = dbe_->book1D(dmrYprimeHistoName.str(),dmrYprimeHistoTitle.str(),nBinsX,xMin,xMax)->getTH1();
725  }
726  else if(iHier->componentName == "Strip"){
727  this->getBinning("TH1DmrXprimeStripModules",nBinsX,xMin,xMax);
728  iHier->harvestingHistos.DmrXprime = dbe_->book1D(dmrXprimeHistoName.str(),dmrXprimeHistoTitle.str(),nBinsX,xMin,xMax)->getTH1();
729  if(!parSet_.getParameter<bool>("stripYDmrs"))continue;
730  this->getBinning("TH1DmrYprimeStripModules",nBinsX,xMin,xMax);
731  iHier->harvestingHistos.DmrYprime = dbe_->book1D(dmrYprimeHistoName.str(),dmrYprimeHistoTitle.str(),nBinsX,xMin,xMax)->getTH1();
732  }
733  }
734 }
T getParameter(std::string const &) const
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
Definition: DQMStore.cc:717
std::vector< HarvestingHierarchy > vHarvestingHierarchy_
void getBinning(const std::string &binningPSetName, int &nBinsX, double &lowerBoundX, double &upperBoundX) const
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
void TrackerOfflineValidationSummary::collateHarvestingHists ( TTree &  tree)
private
void TrackerOfflineValidationSummary::endJob ( void  )
privatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 210 of file TrackerOfflineValidationSummary.cc.

References collateHarvestingHists(), fillTree(), mPxbResiduals_, mPxeResiduals_, mTecResiduals_, mTibResiduals_, mTidResiduals_, mTobResiduals_, tkGeom_, and MainPageGenerator::tree.

211 {
212  AlignableTracker aliTracker(&(*tkGeom_));
213 
214  TTree* tree = new TTree("TkOffVal","TkOffVal");
215 
216  TkOffTreeVariables *treeMemPtr = new TkOffTreeVariables;
217  // We create branches for all members of 'TkOffTreeVariables' (even if not needed).
218  // This works because we have a dictionary for 'TkOffTreeVariables'
219  // (see src/classes_def.xml and src/classes.h):
220  tree->Branch("TkOffTreeVariables", &treeMemPtr); // address of pointer!
221  // second branch needed for assigning names and titles to harvesting histograms consistent to others
222  std::map<std::string,std::string> *substructureName = new std::map<std::string,std::string>;
223  tree->Branch("SubstructureName", &substructureName, 32000, 00); // SplitLevel must be set to zero
224 
225 
226  this->fillTree(*tree, mPxbResiduals_, *treeMemPtr, *tkGeom_, *substructureName);
227  this->fillTree(*tree, mPxeResiduals_, *treeMemPtr, *tkGeom_, *substructureName);
228  this->fillTree(*tree, mTibResiduals_, *treeMemPtr, *tkGeom_, *substructureName);
229  this->fillTree(*tree, mTidResiduals_, *treeMemPtr, *tkGeom_, *substructureName);
230  this->fillTree(*tree, mTobResiduals_, *treeMemPtr, *tkGeom_, *substructureName);
231  this->fillTree(*tree, mTecResiduals_, *treeMemPtr, *tkGeom_, *substructureName);
232 
233  //dbe_->showDirStructure();
234  //dbe_->save("dqmOut.root");
235 
236  // Method for filling histograms which show summarized values (mean, rms, median ...)
237  // of the module-based histograms from TrackerOfflineValidation
238  this->collateHarvestingHists(*tree);
239 
240  delete tree; tree = 0;
241  delete treeMemPtr; treeMemPtr = 0;
242  delete substructureName; substructureName = 0;
243 }
container to hold data to be written into TTree
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mPxbResiduals_
edm::ESHandle< TrackerGeometry > tkGeom_
void fillTree(TTree &tree, std::map< int, TrackerOfflineValidationSummary::ModuleHistos > &moduleHist, TkOffTreeVariables &treeMem, const TrackerGeometry &tkgeom, std::map< std::string, std::string > &substructureName)
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mTibResiduals_
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mTobResiduals_
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mPxeResiduals_
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mTidResiduals_
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > mTecResiduals_
void TrackerOfflineValidationSummary::fillHarvestingHists ( TTree &  tree)
private

Definition at line 748 of file TrackerOfflineValidationSummary.cc.

References TkOffTreeVariables::entries, edm::ParameterSet::getParameter(), TkOffTreeVariables::medianX, TkOffTreeVariables::medianY, parSet_, and vHarvestingHierarchy_.

Referenced by collateHarvestingHists().

749 {
750  TkOffTreeVariables *treeMemPtr = 0;
751  std::map<std::string,std::string> *substructureName = 0;
752  tree.SetBranchAddress("TkOffTreeVariables", &treeMemPtr);
753  tree.SetBranchAddress("SubstructureName", &substructureName);
754 
755  const unsigned int minEntriesPerModule(parSet_.getParameter<unsigned int>("minEntriesPerModuleForDmr"));
756  edm::LogInfo("TrackerOfflineValidationSummary")<<"Median of a module is added to DMR plots if it contains at least "<<minEntriesPerModule<<" hits";
757 
758  for(std::vector<HarvestingHierarchy>::iterator iHier = vHarvestingHierarchy_.begin(); iHier != vHarvestingHierarchy_.end(); ++iHier){
759  for(std::vector<unsigned int>::const_iterator iTreeEntries = iHier->treeEntries.begin(); iTreeEntries != iHier->treeEntries.end(); ++iTreeEntries){
760  tree.GetEntry(*iTreeEntries);
761  if(treeMemPtr->entries < minEntriesPerModule)continue;
762  iHier->harvestingHistos.DmrXprime->Fill(treeMemPtr->medianX);
763  if(iHier->harvestingHistos.DmrYprime)iHier->harvestingHistos.DmrYprime->Fill(treeMemPtr->medianY);
764  }
765  }
766 }
T getParameter(std::string const &) const
container to hold data to be written into TTree
std::vector< HarvestingHierarchy > vHarvestingHierarchy_
void TrackerOfflineValidationSummary::fillTree ( TTree &  tree,
std::map< int, TrackerOfflineValidationSummary::ModuleHistos > &  moduleHist,
TkOffTreeVariables treeMem,
const TrackerGeometry tkgeom,
std::map< std::string, std::string > &  substructureName 
)
private

Definition at line 247 of file TrackerOfflineValidationSummary.cc.

References associateModuleHistsWithTree(), PXFDetId::blade(), TkOffTreeVariables::blade, TkOffTreeVariables::chi2PerDofX, TkOffTreeVariables::chi2PerDofY, TkOffTreeVariables::clear(), dbe_, SiPixelRawToDigiRegional_cfi::deltaPhi, PXFDetId::disk(), dPhi(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, TkOffTreeVariables::entries, PV3DBase< T, PVType, FrameType >::eta(), TkOffTreeVariables::fitMeanNormX, TkOffTreeVariables::fitMeanNormY, TkOffTreeVariables::fitMeanX, TkOffTreeVariables::fitMeanY, fitResiduals(), TkOffTreeVariables::fitSigmaNormX, TkOffTreeVariables::fitSigmaNormY, TkOffTreeVariables::fitSigmaX, TkOffTreeVariables::fitSigmaY, getMedian(), edm::ParameterSet::getParameter(), h, TkOffTreeVariables::half, TkOffTreeVariables::histNameLocalX, TkOffTreeVariables::histNameNormLocalX, TkOffTreeVariables::histNameNormX, TkOffTreeVariables::histNameNormY, TkOffTreeVariables::histNameX, TkOffTreeVariables::histNameY, TrackerGeometry::idToDet(), TOBDetId::isDoubleSide(), TIBDetId::isDoubleSide(), TIDDetId::isDoubleSide(), TECDetId::isDoubleSide(), TkOffTreeVariables::isDoubleSide, TkOffTreeVariables::isStereo, PXBDetId::ladder(), PXBDetId::layer(), TOBDetId::layer(), TIBDetId::layer(), TkOffTreeVariables::layer, TkOffTreeVariables::meanLocalX, TkOffTreeVariables::meanNormLocalX, TkOffTreeVariables::meanNormX, TkOffTreeVariables::meanNormY, TkOffTreeVariables::meanX, TkOffTreeVariables::meanY, TkOffTreeVariables::medianX, TkOffTreeVariables::medianY, PXBDetId::module(), PXFDetId::module(), TOBDetId::module(), TIBDetId::module(), TIDDetId::module(), TECDetId::module(), TkOffTreeVariables::module, TkOffTreeVariables::moduleId, TkOffTreeVariables::numberOfOutliers, TkOffTreeVariables::numberOfOverflows, TkOffTreeVariables::numberOfUnderflows, TkOffTreeVariables::outerInner, PXFDetId::panel(), TkOffTreeVariables::panel, parSet_, PV3DBase< T, PVType, FrameType >::perp(), TECDetId::petal(), TkOffTreeVariables::petal, PV3DBase< T, PVType, FrameType >::phi(), TkOffTreeVariables::phiDirection, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, TkOffTreeVariables::posEta, GeomDet::position(), TkOffTreeVariables::posPhi, TkOffTreeVariables::posR, TkOffTreeVariables::posX, TkOffTreeVariables::posY, TkOffTreeVariables::posZ, DetId::rawId(), TkOffTreeVariables::rDirection, DQMStore::removeElement(), TIDDetId::ring(), TECDetId::ring(), TkOffTreeVariables::ring, TkOffTreeVariables::rmsLocalX, TkOffTreeVariables::rmsNormLocalX, TkOffTreeVariables::rmsNormX, TkOffTreeVariables::rmsNormY, TkOffTreeVariables::rmsX, TkOffTreeVariables::rmsY, TOBDetId::rod(), TkOffTreeVariables::rod, TkOffTreeVariables::rOrZDirection, DQMStore::setCurrentFolder(), PXFDetId::side(), TIDDetId::side(), TECDetId::side(), TkOffTreeVariables::side, SiStripDetId::stereo(), TIBDetId::string(), DetId::subdetId(), TkOffTreeVariables::subDetId, GeomDet::surface(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, StripSubdetector::TOB, Surface::toGlobal(), useFit_, TIDDetId::wheel(), TECDetId::wheel(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), PV3DBase< T, PVType, FrameType >::z(), and TkOffTreeVariables::zDirection.

Referenced by endJob().

250 {
251  for(std::map<int, TrackerOfflineValidationSummary::ModuleHistos>::iterator it = moduleHist.begin(),
252  itEnd= moduleHist.end(); it != itEnd;++it ) {
253  treeMem.clear(); // make empty/default
254 
255  //variables concerning the tracker components/hierarchy levels
256  const DetId detId = it->first;
257  treeMem.moduleId = detId;
258  treeMem.subDetId = detId.subdetId();
259 
261  PXBDetId pxbId(detId);
262  unsigned int whichHalfBarrel(1), rawId(detId.rawId()); //DetId does not know about halfBarrels is PXB ...
263  if( (rawId>=302056964 && rawId<302059300) || (rawId>=302123268 && rawId<302127140) || (rawId>=302189572 && rawId<302194980) )whichHalfBarrel=2;
264  treeMem.layer = pxbId.layer();
265  treeMem.half = whichHalfBarrel;
266  treeMem.rod = pxbId.ladder(); // ... so, ladder is not per halfBarrel-Layer, but per barrel-layer! Needs complicated calculation in associateModuleHistsWithTree()
267  treeMem.module = pxbId.module();
268  } else if(treeMem.subDetId == PixelSubdetector::PixelEndcap){
269  PXFDetId pxfId(detId);
270  unsigned int whichHalfCylinder(1), rawId(detId.rawId()); //DetId does not kmow about halfCylinders in PXF
271  if( (rawId>=352394500 && rawId<352406032) || (rawId>=352460036 && rawId<352471568) || (rawId>=344005892 && rawId<344017424) || (rawId>=344071428 && rawId<344082960) )whichHalfCylinder=2;
272  treeMem.layer = pxfId.disk();
273  treeMem.side = pxfId.side();
274  treeMem.half = whichHalfCylinder;
275  treeMem.blade = pxfId.blade();
276  treeMem.panel = pxfId.panel();
277  treeMem.module = pxfId.module();
278  } else if(treeMem.subDetId == StripSubdetector::TIB){
279  TIBDetId tibId(detId);
280  unsigned int whichHalfShell(1), rawId(detId.rawId()); //DetId does not kmow about halfShells in TIB
281  if ( (rawId>=369120484 && rawId<369120688) || (rawId>=369121540 && rawId<369121776) || (rawId>=369136932 && rawId<369137200) || (rawId>=369137988 && rawId<369138288) ||
282  (rawId>=369153396 && rawId<369153744) || (rawId>=369154436 && rawId<369154800) || (rawId>=369169844 && rawId<369170256) || (rawId>=369170900 && rawId<369171344) ||
283  (rawId>=369124580 && rawId<369124784) || (rawId>=369125636 && rawId<369125872) || (rawId>=369141028 && rawId<369141296) || (rawId>=369142084 && rawId<369142384) ||
284  (rawId>=369157492 && rawId<369157840) || (rawId>=369158532 && rawId<369158896) || (rawId>=369173940 && rawId<369174352) || (rawId>=369174996 && rawId<369175440) ) whichHalfShell=2;
285  treeMem.layer = tibId.layer();
286  treeMem.side = tibId.string()[0];
287  treeMem.half = whichHalfShell;
288  treeMem.rod = tibId.string()[2];
289  treeMem.outerInner = tibId.string()[1];
290  treeMem.module = tibId.module();
291  treeMem.isStereo = tibId.stereo();
292  treeMem.isDoubleSide = tibId.isDoubleSide();
293  } else if(treeMem.subDetId == StripSubdetector::TID){
294  TIDDetId tidId(detId);
295  treeMem.layer = tidId.wheel();
296  treeMem.side = tidId.side();
297  treeMem.ring = tidId.ring();
298  treeMem.outerInner = tidId.module()[0];
299  treeMem.module = tidId.module()[1];
300  treeMem.isStereo = tidId.stereo();
301  treeMem.isDoubleSide = tidId.isDoubleSide();
302  } else if(treeMem.subDetId == StripSubdetector::TOB){
303  TOBDetId tobId(detId);
304  treeMem.layer = tobId.layer();
305  treeMem.side = tobId.rod()[0];
306  treeMem.rod = tobId.rod()[1];
307  treeMem.module = tobId.module();
308  treeMem.isStereo = tobId.stereo();
309  treeMem.isDoubleSide = tobId.isDoubleSide();
310  } else if(treeMem.subDetId == StripSubdetector::TEC) {
311  TECDetId tecId(detId);
312  treeMem.layer = tecId.wheel();
313  treeMem.side = tecId.side();
314  treeMem.ring = tecId.ring();
315  treeMem.petal = tecId.petal()[1];
316  treeMem.outerInner = tecId.petal()[0];
317  treeMem.module = tecId.module();
318  treeMem.isStereo = tecId.stereo();
319  treeMem.isDoubleSide = tecId.isDoubleSide();
320  }
321 
322  //variables concerning the tracker geometry
323 
324  const Surface::PositionType &gPModule = tkgeom.idToDet(detId)->position();
325  treeMem.posPhi = gPModule.phi();
326  treeMem.posEta = gPModule.eta();
327  treeMem.posR = gPModule.perp();
328  treeMem.posX = gPModule.x();
329  treeMem.posY = gPModule.y();
330  treeMem.posZ = gPModule.z();
331 
332  const Surface& surface = tkgeom.idToDet(detId)->surface();
333 
334  //global Orientation of local coordinate system of dets/detUnits
335  LocalPoint lUDirection(1.,0.,0.), lVDirection(0.,1.,0.), lWDirection(0.,0.,1.);
336  GlobalPoint gUDirection = surface.toGlobal(lUDirection),
337  gVDirection = surface.toGlobal(lVDirection),
338  gWDirection = surface.toGlobal(lWDirection);
339  double dR(999.), dPhi(999.), dZ(999.);
341  dR = gWDirection.perp() - gPModule.perp();
342  dPhi = deltaPhi(gUDirection.phi(),gPModule.phi());
343  dZ = gVDirection.z() - gPModule.z();
344  if(dZ>=0.)treeMem.rOrZDirection = 1; else treeMem.rOrZDirection = -1;
345  }else if(treeMem.subDetId==PixelSubdetector::PixelEndcap){
346  dR = gUDirection.perp() - gPModule.perp();
347  dPhi = deltaPhi(gVDirection.phi(),gPModule.phi());
348  dZ = gWDirection.z() - gPModule.z();
349  if(dR>=0.)treeMem.rOrZDirection = 1; else treeMem.rOrZDirection = -1;
350  }else if(treeMem.subDetId==StripSubdetector::TID || treeMem.subDetId==StripSubdetector::TEC){
351  dR = gVDirection.perp() - gPModule.perp();
352  dPhi = deltaPhi(gUDirection.phi(),gPModule.phi());
353  dZ = gWDirection.z() - gPModule.z();
354  if(dR>=0.)treeMem.rOrZDirection = 1; else treeMem.rOrZDirection = -1;
355  }
356  if(dR>=0.)treeMem.rDirection = 1; else treeMem.rDirection = -1;
357  if(dPhi>=0.)treeMem.phiDirection = 1; else treeMem.phiDirection = -1;
358  if(dZ>=0.)treeMem.zDirection = 1; else treeMem.zDirection = -1;
359 
360 
361  // Assign histos from first step (TrackerOfflineValidation) to the module's entry in the TTree for retrieving mean, rms, median ...
362  const std::string histDir = associateModuleHistsWithTree(treeMem, it->second, substructureName);
363 
364 
365  //mean and RMS values (extracted from histograms Xprime on module level)
366  treeMem.entries = static_cast<UInt_t>(it->second.ResXprimeHisto->GetEntries());
367  treeMem.meanX = it->second.ResXprimeHisto->GetMean();
368  treeMem.rmsX = it->second.ResXprimeHisto->GetRMS();
369  //treeMem.sigmaX = Fwhm(it->second.ResXprimeHisto)/2.355;
370  if (useFit_) {
371  //call fit function which returns mean and sigma from the fit
372  //for absolute residuals
373  std::pair<float,float> fitResult1 = this->fitResiduals(it->second.ResXprimeHisto);
374  treeMem.fitMeanX = fitResult1.first;
375  treeMem.fitSigmaX = fitResult1.second;
376  //for normalized residuals
377  std::pair<float,float> fitResult2 = this->fitResiduals(it->second.NormResXprimeHisto);
378  treeMem.fitMeanNormX = fitResult2.first;
379  treeMem.fitSigmaNormX = fitResult2.second;
380  }
381 
382  //get median for absolute residuals
383  treeMem.medianX = this->getMedian(it->second.ResXprimeHisto);
384 
385  int numberOfBins=it->second.ResXprimeHisto->GetNbinsX();
386  treeMem.numberOfUnderflows = it->second.ResXprimeHisto->GetBinContent(0);
387  treeMem.numberOfOverflows = it->second.ResXprimeHisto->GetBinContent(numberOfBins+1);
388  treeMem.numberOfOutliers = it->second.ResXprimeHisto->GetBinContent(0)+it->second.ResXprimeHisto->GetBinContent(numberOfBins+1);
389  //mean and RMS values (extracted from histograms(normalized Xprime on module level)
390  treeMem.meanNormX = it->second.NormResXprimeHisto->GetMean();
391  treeMem.rmsNormX = it->second.NormResXprimeHisto->GetRMS();
392 
393  double stats[20];
394  it->second.NormResXprimeHisto->GetStats(stats);
395  // GF treeMem.chi2PerDofX = stats[3]/(stats[0]-1);
396  if (stats[0]) treeMem.chi2PerDofX = stats[3]/stats[0];
397 
398  //treeMem.sigmaNormX = Fwhm(it->second.NormResXprimeHisto)/2.355;
399  treeMem.histNameX = it->second.ResXprimeHisto->GetName();
400  treeMem.histNameNormX = it->second.NormResXprimeHisto->GetName();
401 
402 
403  // fill tree variables in local coordinates if set in cfg of TrackerOfllineValidation
404  if(it->second.ResHisto && it->second.NormResHisto){ // if(lCoorHistOn_) {
405  treeMem.meanLocalX = it->second.ResHisto->GetMean();
406  treeMem.rmsLocalX = it->second.ResHisto->GetRMS();
407  treeMem.meanNormLocalX = it->second.NormResHisto->GetMean();
408  treeMem.rmsNormLocalX = it->second.NormResHisto->GetRMS();
409  treeMem.histNameLocalX = it->second.ResHisto->GetName();
410  treeMem.histNameNormLocalX = it->second.NormResHisto->GetName();
411  }
412 
413  // mean and RMS values in local y (extracted from histograms Yprime on module level)
414  // might exist in pixel only
415  if (it->second.ResYprimeHisto) { //(stripYResiduals_){
416  TH1 *h = it->second.ResYprimeHisto;
417  treeMem.meanY = h->GetMean();
418  treeMem.rmsY = h->GetRMS();
419 
420  if (useFit_) { // fit function which returns mean and sigma from the fit
421  std::pair<float,float> fitMeanSigma = this->fitResiduals(h);
422  treeMem.fitMeanY = fitMeanSigma.first;
423  treeMem.fitSigmaY = fitMeanSigma.second;
424  }
425 
426  //get median for absolute residuals
427  treeMem.medianY = this->getMedian(h);
428 
429  treeMem.histNameY = h->GetName();
430  }
431 
432  if (it->second.NormResYprimeHisto) {
433  TH1 *h = it->second.NormResYprimeHisto;
434  treeMem.meanNormY = h->GetMean();
435  treeMem.rmsNormY = h->GetRMS();
436  h->GetStats(stats); // stats buffer defined above
437  if (stats[0]) treeMem.chi2PerDofY = stats[3]/stats[0];
438 
439  if (useFit_) { // fit function which returns mean and sigma from the fit
440  std::pair<float,float> fitMeanSigma = this->fitResiduals(h);
441  treeMem.fitMeanNormY = fitMeanSigma.first;
442  treeMem.fitSigmaNormY = fitMeanSigma.second;
443  }
444  treeMem.histNameNormY = h->GetName();
445  }
446 
447  // Delete module level hists if set in cfg
448  const bool removeModuleLevelHists(parSet_.getParameter<bool>("removeModuleLevelHists"));
449  if(removeModuleLevelHists){
450  dbe_->setCurrentFolder("");
451  if(it->second.ResHisto) dbe_->removeElement(histDir + "/" + it->second.ResHisto->GetName());
452  if(it->second.NormResHisto) dbe_->removeElement(histDir + "/" + it->second.NormResHisto->GetName());
453  if(it->second.ResXprimeHisto) dbe_->removeElement(histDir + "/" + it->second.ResXprimeHisto->GetName());
454  if(it->second.NormResXprimeHisto)dbe_->removeElement(histDir + "/" + it->second.NormResXprimeHisto->GetName());
455  if(it->second.ResYprimeHisto) dbe_->removeElement(histDir + "/" + it->second.ResYprimeHisto->GetName());
456  if(it->second.NormResYprimeHisto)dbe_->removeElement(histDir + "/" + it->second.NormResYprimeHisto->GetName());
457  }
458 
459  tree.Fill();
460  }
461 }
GlobalPoint toGlobal(const Point2DBase< Scalar, LocalTag > lp) const
Definition: Surface.h:78
T getParameter(std::string const &) const
T perp() const
Definition: PV3DBase.h:71
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
T y() const
Definition: PV3DBase.h:62
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
const Surface::PositionType & position() const
The position (origin of the R.F.)
Definition: GeomDet.h:41
double dPhi(double phi1, double phi2)
Definition: JetUtil.h:30
const std::string associateModuleHistsWithTree(const TkOffTreeVariables &treeMem, TrackerOfflineValidationSummary::ModuleHistos &moduleHists, std::map< std::string, std::string > &substructureName)
T z() const
Definition: PV3DBase.h:63
void removeElement(const std::string &name)
Definition: DQMStore.cc:2572
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
std::pair< float, float > fitResiduals(TH1 *hist) const
virtual const GeomDet * idToDet(DetId) const
std::string histNameNormLocalX
unsigned int UInt_t
Definition: FUTypes.h:12
Definition: DetId.h:20
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
std::string histNameLocalX
T eta() const
Definition: PV3DBase.h:75
void clear()
set to empty values
const BoundPlane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:35
T x() const
Definition: PV3DBase.h:61
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:429
std::pair< float, float > TrackerOfflineValidationSummary::fitResiduals ( TH1 *  hist) const
private

Definition at line 593 of file TrackerOfflineValidationSummary.cc.

References alignCSCRings::e, timingPdfMaker::mean, and cms::Exception::what().

Referenced by fillTree().

594 {
595  std::pair<float,float> fitResult(9999., 9999.);
596  if (!hist || hist->GetEntries() < 20) return fitResult;
597 
598  float mean = hist->GetMean();
599  float sigma = hist->GetRMS();
600 
601  try { // for < CMSSW_2_2_0 since ROOT warnings from fit are converted to exceptions
602  // Remove the try/catch for more recent CMSSW!
603  // first fit: two RMS around mean
604  TF1 func("tmp", "gaus", mean - 2.*sigma, mean + 2.*sigma);
605  if (0 == hist->Fit(&func,"QNR")) { // N: do not blow up file by storing fit!
606  mean = func.GetParameter(1);
607  sigma = func.GetParameter(2);
608  // second fit: three sigma of first fit around mean of first fit
609  func.SetRange(mean - 3.*sigma, mean + 3.*sigma);
610  // I: integral gives more correct results if binning is too wide
611  // L: Likelihood can treat empty bins correctly (if hist not weighted...)
612  if (0 == hist->Fit(&func, "Q0LR")) {
613  if (hist->GetFunction(func.GetName())) { // Take care that it is later on drawn:
614  hist->GetFunction(func.GetName())->ResetBit(TF1::kNotDraw);
615  }
616  fitResult.first = func.GetParameter(1);
617  fitResult.second = func.GetParameter(2);
618  }
619  }
620  } catch (cms::Exception const & e) {
621  edm::LogWarning("Alignment") << "@SUB=TrackerOfflineValidation::fitResiduals"
622  << "Caught this exception during ROOT fit: "
623  << e.what();
624  }
625  return fitResult;
626 }
virtual char const * what() const
Definition: Exception.cc:141
void TrackerOfflineValidationSummary::getBinning ( const std::string &  binningPSetName,
int &  nBinsX,
double &  lowerBoundX,
double &  upperBoundX 
) const
private

Definition at line 738 of file TrackerOfflineValidationSummary.cc.

References edm::ParameterSet::getParameter(), and parSet_.

Referenced by bookHarvestingHists().

739 {
740  const edm::ParameterSet& binningPSet = parSet_.getParameter<edm::ParameterSet>(binningPSetName);
741  nBinsX = binningPSet.getParameter<int>("Nbinx");
742  lowerBoundX = binningPSet.getParameter<double>("xmin");
743  upperBoundX = binningPSet.getParameter<double>("xmax");
744 }
T getParameter(std::string const &) const
float TrackerOfflineValidationSummary::getMedian ( const TH1 *  hist) const
private

Definition at line 630 of file TrackerOfflineValidationSummary.cc.

References j, pileupCalc::nbins, vdt::x, and detailsBasic3DVector::y.

Referenced by fillTree().

631 {
632  float median = 999;
633  const int nbins = histo->GetNbinsX();
634 
635  //extract median from histogram
636  double *x = new double[nbins];
637  double *y = new double[nbins];
638  for (int j = 0; j < nbins; j++) {
639  x[j] = histo->GetBinCenter(j+1);
640  y[j] = histo->GetBinContent(j+1);
641  }
642  median = TMath::Median(nbins, x, y);
643 
644  delete[] x; x = 0;
645  delete [] y; y = 0;
646 
647  return median;
648 }
int j
Definition: DBlmapReader.cc:9
x
Definition: VDTMath.h:216

Member Data Documentation

DQMStore* TrackerOfflineValidationSummary::dbe_
private
const std::string TrackerOfflineValidationSummary::moduleDirectory_
private
bool TrackerOfflineValidationSummary::moduleMapsInitialized
private

Definition at line 132 of file TrackerOfflineValidationSummary.cc.

Referenced by analyze().

std::map<int,TrackerOfflineValidationSummary::ModuleHistos> TrackerOfflineValidationSummary::mPxbResiduals_
private

Definition at line 134 of file TrackerOfflineValidationSummary.cc.

Referenced by analyze(), and endJob().

std::map<int,TrackerOfflineValidationSummary::ModuleHistos> TrackerOfflineValidationSummary::mPxeResiduals_
private

Definition at line 135 of file TrackerOfflineValidationSummary.cc.

Referenced by analyze(), and endJob().

std::map<int,TrackerOfflineValidationSummary::ModuleHistos> TrackerOfflineValidationSummary::mTecResiduals_
private

Definition at line 139 of file TrackerOfflineValidationSummary.cc.

Referenced by analyze(), and endJob().

std::map<int,TrackerOfflineValidationSummary::ModuleHistos> TrackerOfflineValidationSummary::mTibResiduals_
private

Definition at line 136 of file TrackerOfflineValidationSummary.cc.

Referenced by analyze(), and endJob().

std::map<int,TrackerOfflineValidationSummary::ModuleHistos> TrackerOfflineValidationSummary::mTidResiduals_
private

Definition at line 137 of file TrackerOfflineValidationSummary.cc.

Referenced by analyze(), and endJob().

std::map<int,TrackerOfflineValidationSummary::ModuleHistos> TrackerOfflineValidationSummary::mTobResiduals_
private

Definition at line 138 of file TrackerOfflineValidationSummary.cc.

Referenced by analyze(), and endJob().

const edm::ParameterSet TrackerOfflineValidationSummary::parSet_
private
edm::ESHandle<TrackerGeometry> TrackerOfflineValidationSummary::tkGeom_
private

Definition at line 124 of file TrackerOfflineValidationSummary.cc.

Referenced by analyze(), and endJob().

const bool TrackerOfflineValidationSummary::useFit_
private

Definition at line 128 of file TrackerOfflineValidationSummary.cc.

Referenced by fillTree().

std::vector<HarvestingHierarchy> TrackerOfflineValidationSummary::vHarvestingHierarchy_
private