Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:32

0001 #ifndef PLOTMILLEPEDEIOV_H
0002 #define PLOTMILLEPEDEIOV_H
0003 // Original Author: Gero Flucke
0004 // last change    : $Date: 2012/06/25 13:21:53 $
0005 // by             : $Author: flucke $
0006 //
0007 // PlotMillePedeIOV is a class to plot the IOV dependence of pede parameters
0008 // in case of run-dependend alignment, e.g. for large pixel structures.
0009 // It makes internal use of PlotMillePede and also interfaces
0010 // various selection settings of that class, see PlotMillePede.h.
0011 // (Missing selection possibilities should be simple to add...)
0012 //
0013 // Management of the created histograms is done using the ('ancient')
0014 // class GFHistManager, see description in PlotMillePede.h.
0015 //
0016 // By calling new PlotMillePedeIOV::Draw..(..) commands, usually previously
0017 // drawn canvases are deleted. But if the option 'add' is given, canvases
0018 // from previous Draw-commands are kept (in fact they are re-drawn).
0019 //
0020 // EXAMPLE I: full scale alignment with time dependent large pixel structures
0021 // 
0022 // PlotMillePedeIOV i("treeFile_merge.root");
0023 // i.SetSubDetId(1);      // Select BPIX.
0024 // i.DrawPedeParam("x");
0025 // i.SetSubDetId(2);      // Select FPIX...
0026 // i.AddAdditionalSel("z", 0,100); // ...but only positive z.
0027 // i.DrawPedeParam("add x z");
0028 // i.ClearAdditionalSel();           // Remove selection on z >= 0... 
0029 // i.AddAdditionalSel("z", -100, 0); // ... and request negative z.
0030 // i.DrawPedeParam("add x z");
0031 //
0032 //
0033 // EXAMPLE II: time dependent alignment of large pixel structures
0034 //             using inversion (i.e. errors available), no hierarchy involved
0035 // 
0036 // PlotMillePedeIOV i("treeFile_merge.root");
0037 // i.SetHieraLevel(0); // no hierarchy => lowest level (default is 1, see ctr.)
0038 // i.SetSubDetId(1);      // Select BPIX.
0039 // i.DrawPedeParam("x");
0040 // i.DrawPedeParam("x val"); // same but without error bars
0041 // i.DrawPedeParam("x err add"); // now draw errors vs IOV
0042 // i.SetSubDetId(2);      // Select FPIX...
0043 // i.DrawPedeParam("x val add");
0044 // i.DrawPedeParam("x err add");
0045 
0046 #include <vector>
0047 
0048 class GFHistManager;
0049 class PlotMillePede;
0050 
0051 class PlotMillePedeIOV 
0052 {
0053  public:
0054   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.
0055   virtual ~PlotMillePedeIOV();
0056 
0057   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 
0058 
0059   void SetTitle(const char *title) {fTitle = title;}
0060   const TString& GetTitle() const { return fTitle;}
0061   GFHistManager* GetHistManager() { return fHistManager;}
0062   PlotMillePede* GetPlotMillePede(unsigned int i) { return (i < fIovs.size() ? fIovs[i] : 0);}
0063 
0064 
0065   TString Unique(const char *name) const;
0066   Int_t PrepareAdd(bool addPlots);
0067   template<class T>
0068     void SetLineMarkerStyle(T &object, Int_t num) const;
0069   
0070   void SetSubDetId(Int_t subDet);
0071   void SetSubDetIds(Int_t id1, Int_t id2, Int_t id3 = -1, Int_t id4 = -1, Int_t id5 = -1); // ignores id<n> <= 0
0072   void SetAlignableTypeId(Int_t alignableTypeId);//detunit=1,det=2,...,TIBString=15,etc. from StructureType.h (-1: all)
0073   void SetHieraLevel(Int_t hieraLevel); // select hierarchical level (-1: all)
0074   void SetBowsParameters(bool use = true);//true: bows param. for pede
0075   void AddAdditionalSel(const TString &xyzrPhiNhit, Float_t min, Float_t max); // min <= x,y,z,r,phi,Nhit < max
0076   void ClearAdditionalSel();
0077 
0078   struct ParId {
0079     //parameter identified by id (=DetId), objId (=hieraLevel), parameter
0080   public:
0081     ParId(Int_t id, Int_t objId, Int_t par) :
0082       id_(id), objId_(objId), par_(par) {};
0083     Int_t id_, objId_, par_;
0084 
0085     bool operator< (const ParId& other) const; // needed for use as Key in std::map
0086   };
0087   // end struct ParId
0088 
0089  private:
0090   GFHistManager *fHistManager;
0091   std::vector<PlotMillePede*> fIovs;
0092   TString fTitle;
0093 };
0094 
0095 #endif