CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  private:
79  struct ParId {
80  //parameter identified by id (=DetId), objId (=hieraLevel), parameter
81  public:
82  ParId(Int_t id, Int_t objId, Int_t par) :
83  id_(id), objId_(objId), par_(par) {};
84  Int_t id_, objId_, par_;
85 
86  bool operator< (const ParId& other) const; // needed for use as Key in std::map
87  };
88  // end struct ParId
89 
91  std::vector<PlotMillePede*> fIovs;
92 
93 };
94 
95 #endif
int i
Definition: DBlmapReader.cc:9
void SetBowsParameters(bool use=true)
void SetSubDetIds(Int_t id1, Int_t id2, Int_t id3=-1, Int_t id4=-1, Int_t id5=-1)
GFHistManager * GetHistManager()
TString Unique(const char *name) const
void SetAlignableTypeId(Int_t alignableTypeId)
void DrawPedeParam(Option_t *option="", unsigned int nNonRigidParam=0)
Int_t PrepareAdd(bool addPlots)
const T & max(const T &a, const T &b)
void SetSubDetId(Int_t subDet)
GFHistManager * fHistManager
virtual ~PlotMillePedeIOV()
void ClearAdditionalSel()
std::vector< PlotMillePede * > fIovs
void SetLineMarkerStyle(T &object, Int_t num) const
void SetHieraLevel(Int_t hieraLevel)
PlotMillePede * GetPlotMillePede(unsigned int i)
PlotMillePedeIOV(const char *fileName, Int_t maxIov=-1, Int_t hieraLevel=1)
ParId(Int_t id, Int_t objId, Int_t par)
bool operator<(const ParId &other) const
void AddAdditionalSel(const TString &xyzrPhiNhit, Float_t min, Float_t max)
long double T