Skip to content

Commit 970e0c9

Browse files
authored
Merge pull request #4 from rest-for-physics/jgalan_detector_migration
Adding new TRestRawSignalRecoverChannelsProcess legacy process
2 parents e4f8cb7 + 54ec5df commit 970e0c9

File tree

3 files changed

+125
-0
lines changed

3 files changed

+125
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
/*************************************************************************
2+
* This file is part of the REST software framework. *
3+
* *
4+
* Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5+
* For more information see http://gifna.unizar.es/trex *
6+
* *
7+
* REST is free software: you can redistribute it and/or modify *
8+
* it under the terms of the GNU General Public License as published by *
9+
* the Free Software Foundation, either version 3 of the License, or *
10+
* (at your option) any later version. *
11+
* *
12+
* REST is distributed in the hope that it will be useful, *
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15+
* GNU General Public License for more details. *
16+
* *
17+
* You should have a copy of the GNU General Public License along with *
18+
* REST in $REST_PATH/LICENSE. *
19+
* If not, see http://www.gnu.org/licenses/. *
20+
* For the list of contributors see $REST_PATH/CREDITS. *
21+
*************************************************************************/
22+
23+
#ifndef RestCore_TRestRawSignalRecoverChannelsProcess
24+
#define RestCore_TRestRawSignalRecoverChannelsProcess
25+
26+
#include "TRestLegacyProcess.h"
27+
28+
//! A process allowing to recover selected channels from a TRestRawSignalEvent
29+
class TRestRawSignalRecoverChannelsProcess : public TRestLegacyProcess {
30+
private:
31+
std::vector<Int_t> fChannelIds; //<
32+
33+
public:
34+
void PrintMetadata() override {
35+
BeginPrintProcess();
36+
for (const auto& channelId : fChannelIds) {
37+
RESTMetadata << "Channel id to recover: " << channelId << RESTendl;
38+
}
39+
EndPrintProcess();
40+
}
41+
42+
TRestRawSignalRecoverChannelsProcess() {
43+
RESTWarning << "Creating legacy process TRestRawSignalRecoverChannelsProcess" << RESTendl;
44+
RESTWarning << "This process is now implemented under TRestDetectorSignalRecoveryProcess" << RESTendl;
45+
}
46+
47+
TRestRawSignalRecoverChannelsProcess(char* configFilename) {
48+
RESTWarning << "Creating legacy process TRestRawSignalRecoverChannelsProcess" << RESTendl;
49+
RESTWarning << "This process is now implemented under TRestDetectorSignalRecoveryProcess" << RESTendl;
50+
}
51+
52+
ClassDefOverride(TRestRawSignalRecoverChannelsProcess, 1);
53+
};
54+
#endif

inc/TRestRawZeroSuppresionProcess.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,7 @@ class TRestRawZeroSuppresionProcess : public TRestLegacyProcess {
7575
RESTWarning << "Creating legacy process TRestRawZeroSuppresionProcess" << RESTendl;
7676
RESTWarning << "This process is now implemented under TRestRawToDetectorSignalProcess" << RESTendl;
7777
}
78+
7879
TRestRawZeroSuppresionProcess(char* cfgFileName) {
7980
RESTWarning << "Creating legacy process TRestRawZeroSuppresionProcess" << RESTendl;
8081
RESTWarning << "This process is now implemented under TRestRawToDetectorSignalProcess" << RESTendl;
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
/*************************************************************************
2+
* This file is part of the REST software framework. *
3+
* *
4+
* Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5+
* For more information see http://gifna.unizar.es/trex *
6+
* *
7+
* REST is free software: you can redistribute it and/or modify *
8+
* it under the terms of the GNU General Public License as published by *
9+
* the Free Software Foundation, either version 3 of the License, or *
10+
* (at your option) any later version. *
11+
* *
12+
* REST is distributed in the hope that it will be useful, *
13+
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15+
* GNU General Public License for more details. *
16+
* *
17+
* You should have a copy of the GNU General Public License along with *
18+
* REST in $REST_PATH/LICENSE. *
19+
* If not, see http://www.gnu.org/licenses/. *
20+
* For the list of contributors see $REST_PATH/CREDITS. *
21+
*************************************************************************/
22+
23+
//////////////////////////////////////////////////////////////////////////
24+
/// The TRestRawSignalRecoverChannelsProcess allows to recover a selection
25+
/// of daq channel ids from a TRestRawSignalEvent. The dead channels must
26+
/// be known beforehand and the signal ids to be recovered must be
27+
/// specified through the corresponding section at the RML configuration
28+
/// file.
29+
///
30+
/// The following example will apply the recovery algorithm for the
31+
/// channels with signal ids 17,19,27 and 67. The signal ids must exist
32+
/// in the readout defined through the TRestDetectorReadout structure.
33+
///
34+
/// \code
35+
/// <TRestRawSignalRecoverChannelsProcess name="returnChannels"
36+
/// title="Recovering few channels" verboseLevel="debug" >
37+
/// <parameter name="channelIds" value="{17,27,67}" />
38+
/// </TRestRawSignalRecoverChannelsProcess>
39+
/// \endcode
40+
///
41+
/// The dead channel reconstruction algorithm is for the moment very
42+
/// simple. The charge of the dead channel is directly calculated by
43+
/// using the charge of the adjacent readout channels,
44+
/// \f$s_i = 0.5 \times (s_{i-1} + s_{i+1})\f$
45+
///
46+
/// This process will access the information of the decoding stored in
47+
/// the TRestDetectorReadout definition to assure that the righ signal ids,
48+
/// corresponding to the adjacent channels, are used in the calculation.
49+
///
50+
/// \warning This process will only be functional if the detectorlib
51+
/// was compiled. You may check if it is the case executing the command
52+
/// `rest-config --libs`, and checking the output shows `-lRestDetector`.
53+
///
54+
///--------------------------------------------------------------------------
55+
///
56+
/// RESTsoft - Software for Rare Event Searches with TPCs
57+
///
58+
/// History of developments:
59+
///
60+
/// 2017-November: First implementation of TRestRawSignalRecoverChannelsProcess.
61+
/// Javier Galan
62+
///
63+
/// \class TRestRawSignalRecoverChannelsProcess
64+
/// \author Javier Galan
65+
///
66+
/// <hr>
67+
///
68+
#include "TRestRawSignalRecoverChannelsProcess.h"
69+
70+
ClassImp(TRestRawSignalRecoverChannelsProcess);

0 commit comments

Comments
 (0)