/[PAMELA software]/PamCut/CollectionActions/TrkRigHistoAction/TrkRigHistoAction.cpp
ViewVC logotype

Annotation of /PamCut/CollectionActions/TrkRigHistoAction/TrkRigHistoAction.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Fri Sep 25 15:39:31 2009 UTC (15 years, 5 months ago) by pam-fi
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
FILE REMOVED
Removed from repository (switch to the new Histo1DAction and Histo2DAction framework)

1 pam-fi 1.1 /*
2     * TrkRigHistoAction.cpp
3     *
4     * Created on: 2009-06-05
5     * Author: S. Ricciarini
6     */
7    
8     /*! @file TrkRigHistoAction.cpp The TrkRigHistoAction class implementation file. */
9    
10     #include "TrkRigHistoAction.h"
11    
12     TrkRigHistoAction::TrkRigHistoAction(const char *actionName, std::vector<float> binning) :
13     CollectionAction(actionName), _binning(binning), _histogram(binning.size() - 1, 0) {
14     }
15    
16     void TrkRigHistoAction::OnGood(PamLevel2 *event){
17    
18     float rig = 1./event->GetTrack(0)->GetTrkTrack()->GetDeflection(); // rigidity with sign
19    
20     // Bin identification: rigidity value must be less than (<) bin maximum
21    
22     if (rig < _binning[0] || rig >= _binning[_binning.size() - 1]) {
23     return;
24     }
25    
26     int i = 1;
27     while (rig >= _binning[i]) {
28     i++;
29     }
30     i--;
31    
32     _histogram[i]++;
33    
34     }

  ViewVC Help
Powered by ViewVC 1.1.23