Skip to content

Commit

Permalink
Merge pull request #472 from rest-for-physics/lobis-working-on-veto-r…
Browse files Browse the repository at this point in the history
…eadout

Compute hits energy
  • Loading branch information
lobis authored Sep 8, 2023
2 parents e8b6309 + 443baec commit ee6baf3
Show file tree
Hide file tree
Showing 13 changed files with 355 additions and 291 deletions.
2 changes: 1 addition & 1 deletion doc/tutorials/List of REST Processes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
\brief A list of the different event data processes implemented in REST together with a brief funcionality description.
\brief A list of the different event data processes implemented in REST together with a brief functionality description.

## Data transformation processes

Expand Down
2 changes: 1 addition & 1 deletion macros/REST_DataSummary.C
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ std::vector<string> metadataConditions = {}; // {"sc->fMinValues[0]> 3.8", "sc-
//*** Usage: restManager DataSummary /full/path/file_*pattern*.root [startDate] [endDate]
//*** --------------
//*** TODO: Make this macro more efficient by accessing to the SQL database created by restSQL.
//*** This could be done preserving the actual funcionality by identifying a particular format
//*** This could be done preserving the actual functionality by identifying a particular format
//*** from the first string argument where we provide the SQL server access credentials.
//*** Then we could use both modes ROOT and SQL to crosscheck.
//***
Expand Down
132 changes: 67 additions & 65 deletions pipeline/trex/01_raw.rml
Original file line number Diff line number Diff line change
Expand Up @@ -2,83 +2,85 @@

<TRestManager>

<globals file="globals.xml"/>
<globals file="globals.xml"/>

<globals>
<variable name="RUN_TYPE" value="RawData" overwrite="false" />
<variable name="FORMAT" value="R[fRunNumber]_[fRunTag]_Vm_[TRestDetector::fAmplificationVoltage]_Vd_[TRestDetector::fDriftVoltage]_Pr_[TRestDetector::fPressure]_Gain_[TRestDetector::fElectronicsGain]_Shape_[TRestDetector::fElectronicsShaping]_Clock_[TRestDetector::fElectronicsClock]-[fParentRunNumber].aqs" overwrite="false" />
</globals>
<globals>
<variable name="RUN_TYPE" value="RawData" overwrite="false"/>
<variable name="FORMAT"
value="R[fRunNumber]_[fRunTag]_Vm_[TRestDetector::fAmplificationVoltage]_Vd_[TRestDetector::fDriftVoltage]_Pr_[TRestDetector::fPressure]_Gain_[TRestDetector::fElectronicsGain]_Shape_[TRestDetector::fElectronicsShaping]_Clock_[TRestDetector::fElectronicsClock]-[fParentRunNumber].aqs"
overwrite="false"/>
</globals>

<TRestRun file="run.xml"/>
<TRestRun file="run.xml"/>

<TRestProcessRunner name="RawSignals" title="Raw processing and analysis" verboseLevel="silent">
<TRestProcessRunner name="RawSignals" title="Raw processing and analysis" verboseLevel="silent">

<parameter name="eventsToProcess" value="100" />
<parameter name="eventsToProcess" value="100"/>

<addProcess type="TRestRawMultiFEMINOSToSignalProcess" name="virtualDAQ" value="ON" verboseLevel="silent">
<parameter name="pedScript" value="ped"/>
<parameter name="runScript" value="run"/>
<parameter name="electronics" value="TCMFeminos"/>
</addProcess>
<addProcess type="TRestRawMultiFEMINOSToSignalProcess" name="virtualDAQ" value="ON" verboseLevel="silent">
<parameter name="pedScript" value="ped"/>
<parameter name="runScript" value="run"/>
<parameter name="electronics" value="TCMFeminos"/>
</addProcess>

<addProcess type="TRestRawSignalChannelActivityProcess" name="rawChActivity" value="ON" verboseLevel="silent" >
<parameter name="daqChannels" value="360" />
<parameter name="daqStartChannel" value="4320" />
<parameter name="daqEndChannel" value="4680" />
<parameter name="readoutChannels" value="250" />
<parameter name="readoutStartChannel" value="0" />
<parameter name="readoutEndChannel" value="250" />
</addProcess>
<addProcess type="TRestRawSignalChannelActivityProcess" name="rawChActivity" value="ON" verboseLevel="silent">
<parameter name="daqChannels" value="360"/>
<parameter name="daqStartChannel" value="4320"/>
<parameter name="daqEndChannel" value="4680"/>
<parameter name="readoutChannels" value="250"/>
<parameter name="readoutStartChannel" value="0"/>
<parameter name="readoutEndChannel" value="250"/>
</addProcess>

<addProcess type="TRestEventRateAnalysisProcess" name="rate" observable="all" value="ON" verboseLevel="info" >
<observable name="SecondsFromStart" type="double" value="ON" />
<observable name="HoursFromStart" type="double" value="ON" />
<observable name="EventTimeDelay" type="double" value="ON" />
<observable name="MeanRate_InHz" type="double" value="ON" />
</addProcess>
<addProcess type="TRestEventRateAnalysisProcess" name="rate" observable="all" value="ON" verboseLevel="info">
<observable name="SecondsFromStart" type="double" value="ON"/>
<observable name="HoursFromStart" type="double" value="ON"/>
<observable name="EventTimeDelay" type="double" value="ON"/>
<observable name="MeanRate_InHz" type="double" value="ON"/>
</addProcess>

<addProcess type="TRestRawSignalAnalysisProcess" name="rawAna" value="ON"
baseLineRange="(${BL_MIN},${BL_MAX})" integralRange="(${INT_MIN},${INT_MAX})"
pointThreshold="${POINT_TH}" pointsOverThreshold="${NPOINTS}" signalThreshold="${SGNL_TH}"
verboseLevel="silent" >
<addProcess type="TRestRawSignalAnalysisProcess" name="rawAna" value="ON"
baseLineRange="(${BL_MIN},${BL_MAX})" integralRange="(${INT_MIN},${INT_MAX})"
pointThreshold="${POINT_TH}" pointsOverThreshold="${NPOINTS}" signalThreshold="${SGNL_TH}"
verboseLevel="silent">
// We define all observables except MinValue because is not yet on validation.root
<observable name="pointsoverthres_map" type="map<int,int>" value="ON" />
<observable name="risetime_map" type="map<int,int>" value="ON" />
<observable name="baseline_map" type="map<int,double>" value="ON" />
<observable name="baselinesigma_map" type="map<int,double>" value="ON" />
<observable name="max_amplitude_map" type="map<int,double>" value="ON" />
<observable name="thr_integral_map" type="map<int,double>" value="ON" />
<observable name="BaseLineMean" type="double" value="ON" />
<observable name="BaseLineSigmaMean" type="double" value="ON" />
<observable name="TimeBinsLength" type="double" value="ON" />
<observable name="NumberOfSignals" type="int" value="ON" />
<observable name="NumberOfGoodSignals" type="int" value="ON" />
<observable name="FullIntegral" type="double" value="ON" />
<observable name="ThresholdIntegral" type="double" value="ON" />
<observable name="RiseSlopeAvg" type="double" value="ON" />
<observable name="SlopeIntegral" type="double" value="ON" />
<observable name="RateOfChangeAvg" type="double" value="ON" />
<observable name="RiseTimeAvg" type="double" value="ON" />
<observable name="TripleMaxIntegral" type="double" value="ON" />
<observable name="IntegralBalance" type="double" value="ON" />
<observable name="AmplitudeIntegralRatio" type="double" value="ON" />
<observable name="MinPeakAmplitude" type="double" value="ON" />
<observable name="MaxPeakAmplitude" type="double" value="ON" />
<observable name="PeakAmplitudeIntegral" type="double" value="ON" />
<!--<observable name="MinEventValue" type="double" value="ON" />-->
<observable name="AmplitudeRatio" type="double" value="ON" />
<observable name="MaxPeakTime" type="double" value="ON" />
<observable name="MinPeakTime" type="double" value="ON" />
<observable name="MaxPeakTimeDelay" type="double" value="ON" />
<observable name="AveragePeakTime" type="double" value="ON" />
<observable name="pointsoverthres_map" type="map<int,int>" value="ON"/>
<observable name="risetime_map" type="map<int,int>" value="ON"/>
<observable name="baseline_map" type="map<int,double>" value="ON"/>
<observable name="baselinesigma_map" type="map<int,double>" value="ON"/>
<observable name="max_amplitude_map" type="map<int,double>" value="ON"/>
<observable name="thr_integral_map" type="map<int,double>" value="ON"/>
<observable name="BaseLineMean" type="double" value="ON"/>
<observable name="BaseLineSigmaMean" type="double" value="ON"/>
<observable name="TimeBinsLength" type="double" value="ON"/>
<observable name="NumberOfSignals" type="int" value="ON"/>
<observable name="NumberOfGoodSignals" type="int" value="ON"/>
<observable name="FullIntegral" type="double" value="ON"/>
<observable name="ThresholdIntegral" type="double" value="ON"/>
<observable name="RiseSlopeAvg" type="double" value="ON"/>
<observable name="SlopeIntegral" type="double" value="ON"/>
<observable name="RateOfChangeAvg" type="double" value="ON"/>
<observable name="RiseTimeAvg" type="double" value="ON"/>
<observable name="TripleMaxIntegral" type="double" value="ON"/>
<observable name="IntegralBalance" type="double" value="ON"/>
<observable name="AmplitudeIntegralRatio" type="double" value="ON"/>
<observable name="MinPeakAmplitude" type="double" value="ON"/>
<observable name="MaxPeakAmplitude" type="double" value="ON"/>
<observable name="PeakAmplitudeIntegral" type="double" value="ON"/>
<!--<observable name="MinEventValue" type="double" value="ON" />-->
<observable name="AmplitudeRatio" type="double" value="ON"/>
<observable name="MaxPeakTime" type="double" value="ON"/>
<observable name="MinPeakTime" type="double" value="ON"/>
<observable name="MaxPeakTimeDelay" type="double" value="ON"/>
<observable name="AveragePeakTime" type="double" value="ON"/>

<cut name="NumberOfGoodSignals" value="(1,1000)" />
<parameter name="cutsEnabled" value="true" />
</addProcess>
<cut name="NumberOfGoodSignals" value="(1,1000)"/>
<parameter name="cutsEnabled" value="true"/>
</addProcess>


</TRestProcessRunner>
</TRestProcessRunner>

<addTask type="processEvents" value="ON" />
<addTask type="processEvents" value="ON"/>

</TRestManager>
67 changes: 35 additions & 32 deletions pipeline/trex/02_signal.rml
Original file line number Diff line number Diff line change
Expand Up @@ -2,37 +2,40 @@

<TRestManager>

<globals file="globals.xml"/>
<globals>
<variable name="RUN_TYPE" value="Signals" overwrite="false" />
</globals>

<TRestRun file="run.xml" />

<TRestProcessRunner name="Signals" title="REST Manager. Raw To Track Analysis (analysis without intermediate output)." verboseLevel="silent">

<parameter name="eventsToProcess" value="0" />

<addProcess type="TRestRawToDetectorSignalProcess" name="detSignal" value="ON"
threshold="0.01"
triggerStarts="0us"
gain="1"
zeroSuppression="true"
baseLineRange="(${BL_MIN},${BL_MAX})"
integralRange="(${INT_MIN},${INT_MAX})"
pointThreshold="${POINT_TH}"
nPointsOverThreshold="${NPOINTS}"
sampling="${SAMPLING}"
signalThreshold="${SGNL_TH}"
verboseLevel="silent" />

<addProcess type="TRestDetectorSignalChannelActivityProcess" name="chActivity" value="ON" verboseLevel="info" observable="all" >
<parameter name="daqChannels" value="72*4*4" />
<parameter name="readoutChannels" value="256*2*2" />
</addProcess>

</TRestProcessRunner>

<addTask type="processEvents" value="ON" />
<globals file="globals.xml"/>
<globals>
<variable name="RUN_TYPE" value="Signals" overwrite="false"/>
</globals>

<TRestRun file="run.xml"/>

<TRestProcessRunner name="Signals"
title="REST Manager. Raw To Track Analysis (analysis without intermediate output)."
verboseLevel="silent">

<parameter name="eventsToProcess" value="0"/>

<addProcess type="TRestRawToDetectorSignalProcess" name="detSignal" value="ON"
threshold="0.01"
triggerStarts="0us"
gain="1"
zeroSuppression="true"
baseLineRange="(${BL_MIN},${BL_MAX})"
integralRange="(${INT_MIN},${INT_MAX})"
pointThreshold="${POINT_TH}"
nPointsOverThreshold="${NPOINTS}"
sampling="${SAMPLING}"
signalThreshold="${SGNL_TH}"
verboseLevel="silent"/>

<addProcess type="TRestDetectorSignalChannelActivityProcess" name="chActivity" value="ON" verboseLevel="info"
observable="all">
<parameter name="daqChannels" value="72*4*4"/>
<parameter name="readoutChannels" value="256*2*2"/>
</addProcess>

</TRestProcessRunner>

<addTask type="processEvents" value="ON"/>

</TRestManager>
102 changes: 52 additions & 50 deletions pipeline/trex/03_hits.rml
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,57 @@

<TRestManager>

<globals file="globals.xml"/>
<globals>
<variable name="RUN_TYPE" value="Hits" overwrite="false" />
</globals>

<TRestRun file="run.xml" />

<TRestProcessRunner name="Signals" title="REST Manager. Raw To Track Analysis (analysis without intermediate output)." verboseLevel="silent">

<parameter name="eventsToProcess" value="0" />
<parameter name="outputEvent" value="ON" />

<addProcess type="TRestDetectorSignalToHitsProcess" name="signalToHits" value="ON" verboseLevel="silent"
electricField="${PRESSURE}*${DRIFT_FIELD}"
gasPressure="[detParam::fPressure]"
driftVelocity=""
observable="all"
method="tripleMax" />

<addProcess type="TRestDetectorHitsAnalysisProcess" name="hitsAna" value="ON" verboseLevel="silent" >
<observable name="energy" value="ON" />
<observable name="energyX" value="ON" />
<observable name="energyY" value="ON" />
<observable name="balanceXYenergy" value="ON" />

<observable name="nHits" type="int" value="ON" />
<observable name="nHitsX" type="int" value="ON" />
<observable name="nHitsY" type="int" value="ON" />
<observable name="nHitsSizeXY" value="ON" />

<observable name="maxHitEnergy" value="ON" />
<observable name="minHitEnergy" value="ON" />
<observable name="meanHitEnergy" value="ON" />

<observable name="xMean" value="ON" />
<observable name="yMean" value="ON" />
<observable name="zMean" value="ON" />

<observable name="xSigma" value="ON" />
<observable name="ySigma" value="ON" />
<observable name="xy2Sigma" value="ON" />
<observable name="xySigmaBalance" value="ON" />
<observable name="z2Sigma" value="ON" />
<observable name="xySkew" value="ON" />
<observable name="zSkew" value="ON" />
</addProcess>

</TRestProcessRunner>

<addTask type="processEvents" value="ON" />
<globals file="globals.xml"/>
<globals>
<variable name="RUN_TYPE" value="Hits" overwrite="false"/>
</globals>

<TRestRun file="run.xml"/>

<TRestProcessRunner name="Signals"
title="REST Manager. Raw To Track Analysis (analysis without intermediate output)."
verboseLevel="silent">

<parameter name="eventsToProcess" value="0"/>
<parameter name="outputEvent" value="ON"/>

<addProcess type="TRestDetectorSignalToHitsProcess" name="signalToHits" value="ON" verboseLevel="silent"
electricField="${PRESSURE}*${DRIFT_FIELD}"
gasPressure="[detParam::fPressure]"
driftVelocity=""
observable="all"
method="tripleMax"/>

<addProcess type="TRestDetectorHitsAnalysisProcess" name="hitsAna" value="ON" verboseLevel="silent">
<observable name="energy" value="ON"/>
<observable name="energyX" value="ON"/>
<observable name="energyY" value="ON"/>
<observable name="balanceXYenergy" value="ON"/>

<observable name="nHits" type="int" value="ON"/>
<observable name="nHitsX" type="int" value="ON"/>
<observable name="nHitsY" type="int" value="ON"/>
<observable name="nHitsSizeXY" value="ON"/>

<observable name="maxHitEnergy" value="ON"/>
<observable name="minHitEnergy" value="ON"/>
<observable name="meanHitEnergy" value="ON"/>

<observable name="xMean" value="ON"/>
<observable name="yMean" value="ON"/>
<observable name="zMean" value="ON"/>

<observable name="xSigma" value="ON"/>
<observable name="ySigma" value="ON"/>
<observable name="xy2Sigma" value="ON"/>
<observable name="xySigmaBalance" value="ON"/>
<observable name="z2Sigma" value="ON"/>
<observable name="xySkew" value="ON"/>
<observable name="zSkew" value="ON"/>
</addProcess>

</TRestProcessRunner>

<addTask type="processEvents" value="ON"/>

</TRestManager>
35 changes: 18 additions & 17 deletions pipeline/trex/globals.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<globals>
<!--
<!--
<variable name="AUTO_DAQ_PATH" value="${HOME}/quickAnaREST" overwrite="false" />
<variable name="READOUT_FILE" value="readouts.root" overwrite="false" />
<variable name="READOUT_NAME" value="SingleModule" overwrite="false" />
Expand All @@ -10,25 +10,26 @@
<parameter name="gasDataPath" value="${REST_PATH}/inputData/gasFiles/" />
<searchPath value="$ENV{REST_INPUTDATA}/definitions/"/>
-->
-->

<variable name="RUN_TYPE" value="Test" overwrite="false" />
<variable name="FORMAT" value=" " />
<variable name="RUN_TYPE" value="Test" overwrite="false"/>
<variable name="FORMAT" value=" "/>

<parameter name="mainDataPath" value="." />
<parameter name="verboseLevel" value="silent" /> %options are : silent, warning, info, silent
<parameter name="mainDataPath" value="."/>
<parameter name="verboseLevel" value="silent"/>
%options are : silent, warning, info, silent

<variable name="BL_MIN" value="20" overwrite="false" />
<variable name="BL_MAX" value="150" overwrite="false" />
<variable name="BL_MIN" value="20" overwrite="false"/>
<variable name="BL_MAX" value="150" overwrite="false"/>

<variable name="INT_MIN" value="150" overwrite="false" />
<variable name="INT_MAX" value="450" overwrite="false" />
<variable name="INT_MIN" value="150" overwrite="false"/>
<variable name="INT_MAX" value="450" overwrite="false"/>

<variable name="NPOINTS" value="7" overwrite="false" />
<variable name="POINT_TH" value="3.5" overwrite="false" />
<variable name="SGNL_TH" value="3.5" overwrite="false" />
<variable name="NPOINTS" value="7" overwrite="false"/>
<variable name="POINT_TH" value="3.5" overwrite="false"/>
<variable name="SGNL_TH" value="3.5" overwrite="false"/>

<variable name="SAMPLING" value="80ns" overwrite="false" />
<variable name="PRESSURE" value="6" overwrite="false" />
<variable name="DRIFT_FIELD" value="160" overwrite="false" />
</globals>
<variable name="SAMPLING" value="80ns" overwrite="false"/>
<variable name="PRESSURE" value="6" overwrite="false"/>
<variable name="DRIFT_FIELD" value="160" overwrite="false"/>
</globals>
Loading

0 comments on commit ee6baf3

Please sign in to comment.