[Rivet] set of histograms after different cuts

Andy Buckley andy.buckley at cern.ch
Tue Apr 12 20:04:26 BST 2016


On 12/04/16 17:25, Alexander Grohsjean wrote:
> Dear all,
>
> is there a smart way in Rivet to declare a set of histograms and fill
> each of them at different levels of the event selection.
> I couldn't find any example and was wondering if something like that
> exists.

Hi Alexander,

There's nothing "automatic", but you can do something like this, which 
is pretty easy:

class MyAnalysis : Analysis {
public:

   ...

   void analyze(const Event& e) {
     // Before cuts
     _fillHistos(e, 0);

     ...
     // Cut 1
     _fillHistos(e, 1);

     ...
     // Cut 2
     _fillHistos(e, 2);

     ...
   }


   void _fillHistos(const Event& e, size_t ncut) {
     _h_pT[ncut].fill(get_some_object(e).pT/GeV, e.weight());
   }

   Histo1DPtr _h_pT[5];

};

-- 
Dr Andy Buckley, Lecturer / Royal Society University Research Fellow
Particle Physics Expt Group, University of Glasgow


More information about the Rivet mailing list