1 |
|
/* |
2 |
|
* OBTPktNumCut.h |
3 |
|
* |
4 |
|
* Created on: 18/mar/2010 |
5 |
|
* Author: Nicola Mori |
6 |
|
*/ |
7 |
|
|
8 |
|
#ifndef OBTPKTNUMCUT_H_ |
9 |
|
#define OBTPKTNUMCUT_H_ |
10 |
|
|
11 |
|
#include "../../../PamCut/PamCutBase/PamCutBase.h" |
12 |
|
|
13 |
|
/*! @brief Event selection by OBT and packet number. |
14 |
|
* |
15 |
|
* A list of OBT and packet number couples is checked. Events are discarded if their |
16 |
|
* OBT and PktNum does not match any entry of the list. |
17 |
|
* */ |
18 |
|
class OBTPktNumCut: public PamCut { |
19 |
|
|
20 |
|
public: |
21 |
|
|
22 |
|
/*! @brief Constructor. |
23 |
|
* |
24 |
|
* The list parameter define the events to be selected. |
25 |
|
* |
26 |
|
* @param cutName The cut's name. |
27 |
|
* @param list A list of (OBT, PktNum) pairs. |
28 |
|
* @param verbose If true, a message will be print to std output when an event is found. This can be useful |
29 |
|
* when searching for rare events in many files, to identify which file contains the event |
30 |
|
* by parsing std output. See #OBTPktNumCut.cpp for the current implementation of this message. |
31 |
|
*/ |
32 |
|
OBTPktNumCut(const char *cutName, vector<pair<unsigned int, unsigned int> > &list, bool verbose = false); |
33 |
|
|
34 |
|
/*! @brief Constructor. |
35 |
|
* |
36 |
|
* The OBT and PktNum are stored in a text file given by listFileName. The file must contain two |
37 |
|
* columns of numbers, each row containing the event OBT as first entry and the event PktNum as |
38 |
|
* second. |
39 |
|
* |
40 |
|
* @param cutName The cut's name. |
41 |
|
* @param listFileName The file containing the (OBT, PktNum) pairs. |
42 |
|
*/ |
43 |
|
OBTPktNumCut(const char *cutName, TString listFileName); |
44 |
|
|
45 |
|
/*! @brief Destructor. */ |
46 |
|
~OBTPktNumCut() { |
47 |
|
} |
48 |
|
|
49 |
|
/*! @brief The OBT and packet number check. |
50 |
|
* |
51 |
|
* @param event The event to analyze. |
52 |
|
* @return #CUTOK if the event's OBT and PktNum match one of the pairs specified to the constructor. |
53 |
|
* @return 0 otherwise. |
54 |
|
*/ |
55 |
|
int Check(PamLevel2 *event); |
56 |
|
|
57 |
|
const vector<pair<unsigned int, unsigned int> > &GetList(){ |
58 |
|
return _list; |
59 |
|
} |
60 |
|
|
61 |
|
private: |
62 |
|
|
63 |
|
vector<pair<unsigned int, unsigned int> > _list; |
64 |
|
bool _verbose; |
65 |
|
}; |
66 |
|
#endif /* OBTPKTNUMCUT_H_ */ |