1 |
pam-fi |
1.1 |
/* |
2 |
|
|
* CaloNHitCut.h |
3 |
|
|
* |
4 |
|
|
* Created on: 18-mar-2009 |
5 |
|
|
* Author: Nicola Mori, S. Ricciarini |
6 |
|
|
*/ |
7 |
|
|
|
8 |
|
|
/*! @file CaloNHitCut.h The CaloNHitCut class definition file */ |
9 |
|
|
|
10 |
|
|
#ifndef CALONHITCUT_H_ |
11 |
|
|
#define CALONHITCUT_H_ |
12 |
|
|
|
13 |
|
|
#include "../../PamCutBase/PamCutBase.h" |
14 |
|
|
#include "../../CaloAxis2.h" |
15 |
|
|
|
16 |
|
|
/*! @brief The number of hits cut for the calorimeter. |
17 |
|
|
* An event survives this selection if the number of hit planes in the calorimeter |
18 |
|
|
* is greater than some value. To save computing time, the class |
19 |
|
|
* assumes that the track is externally computed for each event and stored in |
20 |
|
|
* CaloAxis objects; pointers to these objects are passed as arguments to the constructor. |
21 |
|
|
* The Check method will then ignore the PamLevel2 *event and assume that the |
22 |
|
|
* current content of the CaloAxis objects are relative to the current event. |
23 |
|
|
* It is an user's task to ensure that these assumptions are fulfilled every time |
24 |
|
|
* Check or ApplyCut are called. |
25 |
|
|
* |
26 |
|
|
* CUT DEPENDENCIES: CaloTrackCut for the existence of the track (it can also provide the CaloAxis objects). |
27 |
|
|
*/ |
28 |
|
|
|
29 |
|
|
class CaloNHitCut: public PamCut { |
30 |
|
|
|
31 |
|
|
public: |
32 |
|
|
|
33 |
|
|
/*! @brief Constructor. |
34 |
|
|
* |
35 |
|
|
* The CaloAxis arguments are pointers to objects which contain the calorimeter |
36 |
|
|
* track information for current event. |
37 |
|
|
* |
38 |
|
|
* @param cutName The cut name. |
39 |
|
|
* @param xCaloAxis The pointer to the CaloAxis object for X axis. |
40 |
|
|
* @param yCaloAxis The pointer to the CaloAxis object for Y axis. |
41 |
|
|
* @param nMinHit The minimum number of hits. |
42 |
|
|
*/ |
43 |
|
|
CaloNHitCut(const char *cutName, CaloAxis *xCaloAxis, CaloAxis *yCaloAxis, int nMinHit=10) : |
44 |
|
|
PamCut(cutName), _xCaloAxis(xCaloAxis), _yCaloAxis(yCaloAxis), _nMinHit(nMinHit) { |
45 |
|
|
} |
46 |
|
|
/*! @brief Destructor. */ |
47 |
|
|
~CaloNHitCut() { |
48 |
|
|
} |
49 |
|
|
|
50 |
|
|
/*! @brief The number of hit planes check. |
51 |
|
|
* |
52 |
|
|
* The check is done by looking if there is a charge release near the track, using |
53 |
|
|
* the CaloAxis class. If a charge greater than 0 is found by invoking CaloAxis::GetQ for at |
54 |
|
|
* least nMinHit planes (both for X and Y) the condition is fulfilled. |
55 |
|
|
* |
56 |
|
|
* @param event The event to analyze. |
57 |
|
|
* @return #CUTOK if the track hits at least nMinHit planes both in X and Y. |
58 |
|
|
* @return 0 otherwise. |
59 |
|
|
* @see CaloNHitCut::CaloNHitCut |
60 |
|
|
*/ |
61 |
|
|
int Check(PamLevel2 *event); |
62 |
|
|
|
63 |
|
|
private: |
64 |
|
|
CaloAxis *_xCaloAxis, *_yCaloAxis; |
65 |
|
|
int _nMinHit; |
66 |
|
|
|
67 |
|
|
}; |
68 |
|
|
#endif /* CALONHITCUT_H_ */ |
69 |
|
|
|