CMS 3D CMS Logo

Public Member Functions | Private Member Functions

PFTauRenderPlugin Class Reference

List of all members.

Public Member Functions

virtual bool applies (const VisDQMObject &o, const VisDQMImgInfo &)
virtual void postDraw (TCanvas *, const VisDQMObject &, const VisDQMImgInfo &)
virtual void preDraw (TCanvas *canvas, const VisDQMObject &o, const VisDQMImgInfo &, VisDQMRenderInfo &renderInfo)

Private Member Functions

string stripDicriminator (string name)
string stripVar (string name)

Detailed Description

Definition at line 24 of file PFTauRenderPlugin.cc.


Member Function Documentation

virtual bool PFTauRenderPlugin::applies ( const VisDQMObject &  o,
const VisDQMImgInfo &   
) [inline, virtual]

Definition at line 27 of file PFTauRenderPlugin.cc.

    {
      return ((o.name.find( "RecoTauV/" ) != std::string::npos ) && (o.name.find( "Eff" ) != std::string::npos ) ); //Size and SumPt are already configured
    }
virtual void PFTauRenderPlugin::postDraw ( TCanvas *  ,
const VisDQMObject &  ,
const VisDQMImgInfo &   
) [inline, virtual]

Definition at line 56 of file PFTauRenderPlugin.cc.

    {
    }
virtual void PFTauRenderPlugin::preDraw ( TCanvas *  canvas,
const VisDQMObject &  o,
const VisDQMImgInfo &  ,
VisDQMRenderInfo &  renderInfo 
) [inline, virtual]

Definition at line 32 of file PFTauRenderPlugin.cc.

References max(), min, and VarParsing::obj.

    {
      canvas->cd();
      TH1* obj = dynamic_cast<TH1*>( o.object );
      if(!obj) return; //nothing to do for TH2
      //general setings
      //drawing options
      gStyle->SetOptStat(0);
      renderInfo.drawOptions = "E0";
      if(o.name.find( "Rejection" ) != std::string::npos ) canvas->SetLogy();
      if(o.name.find( "RealData"  ) != std::string::npos ) canvas->SetLogy();

      //titles and axis
      string discriminator = stripDicriminator(o.name);
      string variable = stripVar(o.name);
      obj->SetTitle((discriminator+" fake rate vs "+variable).c_str());
      obj->GetXaxis()->SetTitle(variable.c_str());
      obj->GetYaxis()->SetTitle("fake rate");
      double min = (canvas->GetLogy() ) ? 0.001 : 0.;
      double max = (canvas->GetLogy() ) ? 2.    : 1.2;
      obj->GetYaxis()->SetRangeUser(min,max);
      obj->SetMarkerStyle(20);
    }
string PFTauRenderPlugin::stripDicriminator ( string  name) [inline, private]

Definition at line 62 of file PFTauRenderPlugin.cc.

  {
    return name.substr(name.rfind("/")+1,name.rfind("Eff")-name.rfind("/")-1);
  }
string PFTauRenderPlugin::stripVar ( string  name) [inline, private]

Definition at line 66 of file PFTauRenderPlugin.cc.

  {
    return name.substr(name.rfind("Eff")+3);
  }