CMS 3D CMS Logo

PlotMillePedeIOV.h
Go to the documentation of this file.
1 #ifndef PLOTMILLEPEDEIOV_H
2 #define PLOTMILLEPEDEIOV_H
3 // Original Author: Gero Flucke
4 // last change : $Date: 2012/06/25 13:21:53 $
5 // by : $Author: flucke $
6 //
7 // PlotMillePedeIOV is a class to plot the IOV dependence of pede parameters
8 // in case of run-dependend alignment, e.g. for large pixel structures.
9 // It makes internal use of PlotMillePede and also interfaces
10 // various selection settings of that class, see PlotMillePede.h.
11 // (Missing selection possibilities should be simple to add...)
12 //
13 // Management of the created histograms is done using the ('ancient')
14 // class GFHistManager, see description in PlotMillePede.h.
15 //
16 // By calling new PlotMillePedeIOV::Draw..(..) commands, usually previously
17 // drawn canvases are deleted. But if the option 'add' is given, canvases
18 // from previous Draw-commands are kept (in fact they are re-drawn).
19 //
20 // EXAMPLE I: full scale alignment with time dependent large pixel structures
21 //
22 // PlotMillePedeIOV i("treeFile_merge.root");
23 // i.SetSubDetId(1); // Select BPIX.
24 // i.DrawPedeParam("x");
25 // i.SetSubDetId(2); // Select FPIX...
26 // i.AddAdditionalSel("z", 0,100); // ...but only positive z.
27 // i.DrawPedeParam("add x z");
28 // i.ClearAdditionalSel(); // Remove selection on z >= 0...
29 // i.AddAdditionalSel("z", -100, 0); // ... and request negative z.
30 // i.DrawPedeParam("add x z");
31 //
32 //
33 // EXAMPLE II: time dependent alignment of large pixel structures
34 // using inversion (i.e. errors available), no hierarchy involved
35 //
36 // PlotMillePedeIOV i("treeFile_merge.root");
37 // i.SetHieraLevel(0); // no hierarchy => lowest level (default is 1, see ctr.)
38 // i.SetSubDetId(1); // Select BPIX.
39 // i.DrawPedeParam("x");
40 // i.DrawPedeParam("x val"); // same but without error bars
41 // i.DrawPedeParam("x err add"); // now draw errors vs IOV
42 // i.SetSubDetId(2); // Select FPIX...
43 // i.DrawPedeParam("x val add");
44 // i.DrawPedeParam("x err add");
45 
46 #include <vector>
47 
48 class GFHistManager;
49 class PlotMillePede;
50 
52 {
53  public:
54  explicit PlotMillePedeIOV(const char *fileName, Int_t maxIov = -1, Int_t hieraLevel = 1); // maxIov <=0: find out from file!; hieraLev: -1 ignore, 0 lowest level, etc.
55  virtual ~PlotMillePedeIOV();
56 
57  void DrawPedeParam(Option_t *option = "", unsigned int nNonRigidParam = 0);// "add", any of "x","y","z","id" to add position or DetId in legend, "err" error (not value), "val" skip error bar even if valid
58 
59  void SetTitle(const char *title) {fTitle = title;}
60  const TString& GetTitle() const { return fTitle;}
62  PlotMillePede* GetPlotMillePede(unsigned int i) { return (i < fIovs.size() ? fIovs[i] : 0);}
63 
64 
65  TString Unique(const char *name) const;
66  Int_t PrepareAdd(bool addPlots);
67  template<class T>
68  void SetLineMarkerStyle(T &object, Int_t num) const;
69 
70  void SetSubDetId(Int_t subDet);
71  void SetSubDetIds(Int_t id1, Int_t id2, Int_t id3 = -1, Int_t id4 = -1, Int_t id5 = -1); // ignores id<n> <= 0
72  void SetAlignableTypeId(Int_t alignableTypeId);//detunit=1,det=2,...,TIBString=15,etc. from StructureType.h (-1: all)
73  void SetHieraLevel(Int_t hieraLevel); // select hierarchical level (-1: all)
74  void SetBowsParameters(bool use = true);//true: bows param. for pede
75  void AddAdditionalSel(const TString &xyzrPhiNhit, Float_t min, Float_t max); // min <= x,y,z,r,phi,Nhit < max
76  void ClearAdditionalSel();
77 
78  struct ParId {
79  //parameter identified by id (=DetId), objId (=hieraLevel), parameter
80  public:
81  ParId(Int_t id, Int_t objId, Int_t par) :
82  id_(id), objId_(objId), par_(par) {};
83  Int_t id_, objId_, par_;
84 
85  bool operator< (const ParId& other) const; // needed for use as Key in std::map
86  };
87  // end struct ParId
88 
89  private:
91  std::vector<PlotMillePede*> fIovs;
92  TString fTitle;
93 };
94 
95 #endif
PlotMillePedeIOV::ParId::operator<
bool operator<(const ParId &other) const
PlotMillePedeIOV::SetTitle
void SetTitle(const char *title)
Definition: PlotMillePedeIOV.h:59
runGCPTkAlMap.title
string title
Definition: runGCPTkAlMap.py:94
mps_fire.i
i
Definition: mps_fire.py:428
GFHistManager
Definition: GFHistManager.h:20
PlotMillePedeIOV::SetBowsParameters
void SetBowsParameters(bool use=true)
min
T min(T a, T b)
Definition: MathUtil.h:58
PlotMillePedeIOV::GetHistManager
GFHistManager * GetHistManager()
Definition: PlotMillePedeIOV.h:61
globals_cff.id1
id1
Definition: globals_cff.py:33
PlotMillePedeIOV::ParId::par_
Int_t par_
Definition: PlotMillePedeIOV.h:82
PlotMillePedeIOV::ParId::ParId
ParId(Int_t id, Int_t objId, Int_t par)
Definition: PlotMillePedeIOV.h:81
PlotMillePedeIOV::SetAlignableTypeId
void SetAlignableTypeId(Int_t alignableTypeId)
PlotMillePedeIOV::ParId::id_
Int_t id_
Definition: PlotMillePedeIOV.h:82
PlotMillePedeIOV::SetSubDetIds
void SetSubDetIds(Int_t id1, Int_t id2, Int_t id3=-1, Int_t id4=-1, Int_t id5=-1)
MillePedeFileConverter_cfg.fileName
fileName
Definition: MillePedeFileConverter_cfg.py:32
PlotMillePede
Definition: PlotMillePede.h:147
fileinputsource_cfi.option
option
Definition: fileinputsource_cfi.py:87
PlotMillePedeIOV::~PlotMillePedeIOV
virtual ~PlotMillePedeIOV()
PlotMillePedeIOV::fHistManager
GFHistManager * fHistManager
Definition: PlotMillePedeIOV.h:90
trackingPlots.other
other
Definition: trackingPlots.py:1467
PlotMillePedeIOV
Definition: PlotMillePedeIOV.h:51
PlotMillePedeIOV::PrepareAdd
Int_t PrepareAdd(bool addPlots)
PlotMillePedeIOV::ClearAdditionalSel
void ClearAdditionalSel()
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
PlotMillePedeIOV::ParId::objId_
Int_t objId_
Definition: PlotMillePedeIOV.h:82
PlotMillePedeIOV::SetSubDetId
void SetSubDetId(Int_t subDet)
PlotMillePedeIOV::AddAdditionalSel
void AddAdditionalSel(const TString &xyzrPhiNhit, Float_t min, Float_t max)
PlotMillePedeIOV::SetHieraLevel
void SetHieraLevel(Int_t hieraLevel)
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
PlotMillePedeIOV::PlotMillePedeIOV
PlotMillePedeIOV(const char *fileName, Int_t maxIov=-1, Int_t hieraLevel=1)
PlotMillePedeIOV::Unique
TString Unique(const char *name) const
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
T
long double T
Definition: Basic3DVectorLD.h:48
PlotMillePedeIOV::ParId
Definition: PlotMillePedeIOV.h:78
PlotMillePedeIOV::GetPlotMillePede
PlotMillePede * GetPlotMillePede(unsigned int i)
Definition: PlotMillePedeIOV.h:62
PlotMillePedeIOV::fIovs
std::vector< PlotMillePede * > fIovs
Definition: PlotMillePedeIOV.h:91
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
PlotMillePedeIOV::SetLineMarkerStyle
void SetLineMarkerStyle(T &object, Int_t num) const
PlotMillePedeIOV::GetTitle
const TString & GetTitle() const
Definition: PlotMillePedeIOV.h:60
globals_cff.id2
id2
Definition: globals_cff.py:34
PlotMillePedeIOV::fTitle
TString fTitle
Definition: PlotMillePedeIOV.h:92
PlotMillePedeIOV::DrawPedeParam
void DrawPedeParam(Option_t *option="", unsigned int nNonRigidParam=0)