Skip to content

Commit

Permalink
Merge branch 'master' into rest_daq
Browse files Browse the repository at this point in the history
  • Loading branch information
juanangp authored Sep 8, 2023
2 parents 76d7cdc + 1226774 commit d567632
Show file tree
Hide file tree
Showing 30 changed files with 696 additions and 334 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
3 changes: 3 additions & 0 deletions macros/REST_OpenInputFile.C
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ void REST_OpenInputFile(const std::string& fileName) {
if (TRestTools::isRunFile(fileName)) {
printf("\n%s\n\n", "REST processed file identified. It contains a valid TRestRun.");
run = new TRestRun(fileName);
// print number of entries in the run
printf("\nThe run has %lld entries.\n", run->GetEntries());
printf("\nAttaching TRestRun %s as run...\n", fileName.c_str());
ana_tree = run->GetAnalysisTree();
printf("Attaching TRestAnalysisTree as ana_tree...\n");
Expand All @@ -29,6 +31,7 @@ void REST_OpenInputFile(const std::string& fileName) {
}
std::string mName = Replace(metaName, " ", "");
mName = Replace(mName, ".", "_");
mName = Replace(mName, "-", "_");
std::string mdcmd = Form("%s* %s = (%s*)run->GetMetadata(\"%s\");", md->ClassName(),
mName.c_str(), md->ClassName(), metaName.c_str());
gROOT->ProcessLine(mdcmd.c_str());
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>
Loading

0 comments on commit d567632

Please sign in to comment.