forked from eudaq/eudaq
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request eudaq#20 from HGCDAQ/ahcal-in-onlinemon
Ahcal hitmaps in onlinemon
- Loading branch information
Showing
19 changed files
with
787 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,146 @@ | ||
#!/bin/bash | ||
|
||
# ---------- | ||
# This starter script should run all producers at once: | ||
# HGCAL (RPI or IPBUS), AHCAL, WireChamber, etc | ||
#----------- | ||
|
||
export RCPORT=44000 | ||
[ "$1" != "" ] && RCPORT=$1 | ||
|
||
export HOSTIP=127.0.0.1 | ||
export TLUIP=127.0.0.1 | ||
export HOSTNAME=127.0.0.1 | ||
|
||
|
||
dt=`date +"%y_%b_%d_%Hh%Mm"` | ||
echo $dt | ||
if [ -f './data/runnumber.dat' ]; then | ||
RUNNUM=$(cat './data/runnumber.dat') | ||
else | ||
RUNNUM=0 | ||
fi | ||
|
||
NEWRUNNUM=$((RUNNUM+1)) | ||
echo 'Last Run number: ' $RUNNUM 'New Run number:' $NEWRUNNUM | ||
|
||
|
||
cd `dirname $0` | ||
if [ -z "$LD_LIBRARY_PATH" ]; then | ||
export LD_LIBRARY_PATH="`pwd`/lib" | ||
|
||
else | ||
export LD_LIBRARY_PATH="`pwd`/lib:$LD_LIBRARY_PATH" | ||
fi | ||
|
||
if [ ! -d ./data ]; then | ||
mkdir -p ./data; | ||
fi | ||
if [ ! -d ./logs ]; then | ||
mkdir -p ./logs; | ||
fi | ||
if [ ! -d ./data_root ]; then | ||
mkdir -p ./data_root; | ||
fi | ||
if [ ! -d ./snapshots ]; then | ||
mkdir -p ./snapshots; | ||
fi | ||
|
||
mkdir -p ./snapshots/run$NEWRUNNUM/; | ||
|
||
|
||
printf '\033[1;32;48m \t STARTING DAQ LOCALLY\033[0m \n' | ||
echo $(date) | ||
printf '\033[22;33m\t Cleaning up first... \033[0m \n' | ||
|
||
if [ -f KILLRUN.local ] | ||
then | ||
sh KILLRUN.local | ||
else | ||
sh KILLRUN | ||
fi | ||
|
||
printf '\033[22;31m\t End of killall \033[0m \n' | ||
|
||
sleep 1 | ||
|
||
###################################################################### | ||
if [ -n "`ls data/run*.raw`" ] | ||
then | ||
printf '\033[22;33m\t Making sure all data files are properly writeprotected \033[0m \n' | ||
chmod a=rw data/run*.raw | ||
printf '\033[22;32m\t ...Done!\033[0m \n' | ||
fi | ||
|
||
cd bin | ||
#===================================================================== | ||
printf '\033[22;33m\t Starting Subprocesses \033[0m \n' | ||
#===================================================================== | ||
###################################################################### | ||
# euRun | ||
############### | ||
printf '\033[22;33m\t RunControl \033[0m \n' | ||
./euRun.exe -x 0 -y 0 -w 650 -g 550 -a tcp://$RCPORT & | ||
sleep 1 | ||
###################################################################### | ||
# euLog | ||
############### | ||
printf '\033[22;33m\t Logger \033[0m \n' | ||
./euLog.exe -x 0 -y 550 -w 1500 -g 450 -r tcp://$HOSTIP:44000 & | ||
sleep 2 | ||
|
||
###################################################################### | ||
# DataCollector | ||
############### | ||
printf '\033[22;33m\t TestDataCollector \033[0m \n' | ||
#xterm -sb -sl 1000 -geom 80x10-480-900 -fn fixed -T "Data Collector" -e './TestDataCollector.exe -r tcp://$HOSTIP:$RCPORT' & | ||
flog="../logs/Run${NEWRUNNUM}_DataCollector_$dt.log" | ||
nohup ./TestDataCollector.exe -r tcp://$HOSTIP:$RCPORT > $flog 2>&1 & | ||
printf "The logs from the DataCollector are in $flog file. \n" | ||
|
||
sleep 2 | ||
|
||
|
||
###################################################################### | ||
# cnshgcal RpiProducer | ||
############### | ||
printf '\033[22;33m\t cms hgcal *Rpi* Producer \033[0m \n' | ||
xterm -sb -sl 1000 -geom 80x600-280-900 -fn fixed -T "RPI Producer" -e './RpiProducer.exe -r tcp://$HOSTIP:$RCPORT' & | ||
#flog="../logs/Run${NEWRUNNUM}_HGCalProducer_$dt.log" | ||
#nohup ./HGCalProducer.exe -r tcp://$HOSTIP:$RCPORT > $flog 2>&1 & | ||
#printf "The logs from the HGCalProducer are in $flog file. \n" | ||
|
||
sleep 1 | ||
|
||
####################################################################### | ||
# AHCAL producer | ||
#################### | ||
printf '\033[22;33m\t caliceProducer-scintillator \033[0m \n' | ||
xterm -sb -sl 1000000 -geom 160x10-480-900 -fn fixed -T "CALICE AHCAL" -e "./AHCALProducer.exe -n CaliceSc -r tcp://$TLUIP:$RCPORT && read || read" & | ||
#./AHCALProducer.exe -n CaliceSc -r tcp://$TLUIP:$RCPORT | ||
|
||
sleep 2 | ||
|
||
|
||
##################################################################### | ||
if [ -f "HgcOnlineMon.exe" ] | ||
then | ||
printf '\033[22;33m\t HGC Online Monitor \033[0m \n' | ||
flog="../logs/Run${NEWRUNNUM}_HgcOnlineMon_$dt.log" | ||
config_file="../producers/cmshgcal/conf/OnlineMon.conf" | ||
./HgcOnlineMon.exe -u 100 -rf -rs -sc 2 -c $config_file -tc 0 -r tcp://$HOSTIP:$RCPORT | ||
#nohup ./HgcOnlineMon.exe -u 100 -rf -rs -sc 2 -c $config_file -tc 0 -r tcp://$HOSTIP:$RCPORT > $flog 2>&1 & | ||
printf "The logs from the Online Monitor are in $flog file. \n" | ||
|
||
else | ||
printf '\033[22;31m\t Online monitor not found! \033[0m \n' | ||
echo 'Configure EUDAQ with the CMake option "-D BUILD_onlinemon=ON" and re-run "make install" to install.' | ||
fi | ||
##################################################################### | ||
|
||
|
||
printf ' \n' | ||
printf ' \n' | ||
printf ' \n' | ||
printf '\033[1;32;48m\t ...Done!\033[0m \n' | ||
printf '\033[1;32;48mSTART OF DAQ COMPLETE\033[0m \n' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
[RunControl] | ||
RunSizeLimit = 500 | ||
|
||
[DataCollector] | ||
FilePattern = "../data/run$6R$X" | ||
|
||
[LogCollector] | ||
SaveLevel = EXTRA | ||
PrintLevel = DEBUG | ||
|
||
|
||
[Producer.RPI] | ||
RPI_1_IP = '127.0.0.1' | ||
# svhgcal01: | ||
#RPI_1_IP = '128.141.151.253' | ||
# Main RPI on the ReadOut board:: | ||
#RPI_1_IP = '192.168.222.3' | ||
# Spare RPI: | ||
#RPI_1_IP = '192.168.222.99' | ||
|
||
# Other addresses for tests: | ||
#RPI_1_IP = '128.141.196.154' | ||
#RPI_1_IP = '128.141.196.225' | ||
#RPI_1_IP = '128.141.149.196' | ||
|
||
# These should not be changed: | ||
portTCP = '55511' | ||
portUDP = '55512' | ||
|
||
|
||
|
||
|
||
[Producer.CaliceSc] | ||
#FileLEDsettings ="F:\\LEDEUDAQ\\LED1.ini" | ||
FileMode = 0 | ||
WaitMillisecForFile = 3000 | ||
# waitsecondsForQueuedEvents: Sleeping time (in seconds) after clicking stop: needed to read all the events stored in the Labview data queue | ||
waitsecondsForQueuedEvents = 3 | ||
Port = 5622 | ||
IPAddress = "192.168.1.11" | ||
Reader = "Scintillator" | ||
WriteRawOutput = 1 | ||
#RawFileName = "../data/Run_%05d" | ||
RawFileName = "../data/rawAHCAL_%05d" | ||
WriteRawFileNameTimestamp = 0 | ||
ColoredTerminalMessages = 1 | ||
|
||
#LdaTrigidOffset to compensate differences between TLU (or other trigger number source) and LDA. Eudaq Event counting starts from this number and will be always subtracted from the eudaq event triggerid. | ||
LdaTrigidOffset = 1 | ||
#LdaTrigidStartsFrom: The first expected raw triggerID from LDA in the data stream in case it is not 0. It suppresses error warning for the first event. When set higher then the first event, triggers below the provided number are ignored! | ||
LdaTrigidStartsFrom = 1 | ||
#GenerateTriggerIDFrom sets from which triggerID number should be data generated (and filled with dummy triggers if necessary). Only works when insert_dummy_packets is enabled and in selected event building modes | ||
GenerateTriggerIDFrom = 0 | ||
#InsertDummyPackets: 1=inserts dummy packets to keep correct sequence of TrigIDs or ReadOutCycles; 0=do not insert anything | ||
InsertDummyPackets = 1 | ||
|
||
#When RedirectInputFromFile is set, an existing raw raw data file is used as a fake input from detector | ||
#RedirectInputFromFile="/home/calice/Desktop/EUDAQ2-testbeam2017February/data/detector_45015.raw" | ||
RedirectInputFromFile="../data/ahcal/detector_45131.raw" | ||
#EventBuildingMode selects what event building will be used and | ||
#EventBuildingMode = "ROC" | ||
#EventBuildingMode = "TRIGGERID" | ||
#EventBuildingMode = "BUILD_BXID_ALL" | ||
EventBuildingMode = "BUILD_BXID_VALIDATED" | ||
|
||
#EventNumberingPreference chooses a main numbering method, when both are available (especially in BUILD_BXID_VALIDATE and TRIGGERID event building mode) | ||
EventNumberingPreference = "TRIGGERID" | ||
#EventNumberingPreference = "TIMESTAMP" | ||
|
||
#IgnoreLdaTimestamps ignores timestamp in the LDA data stream | ||
IgnoreLdaTimestamps = 0 | ||
|
||
#DebugKeepBuffered: 1=keep events in producer buffer and don't send the data to data collector. 0=pass packets normally | ||
DebugKeepBuffered = 0 | ||
|
||
#AHCALBXID0offset = offset from start acquisition Timestamp to BXID0 (in 25ns steps). Varies with AHCAL powerpulsing setting and DIF firmware | ||
AHCALBXID0Offset = 2123 | ||
#AHCALBXID0Offset = 61415 #powerpulsing | ||
#AHCALBXIDWidth = length of the bxid in 25 ns steps. 4us=160, 200ns=8 | ||
AHCALBXIDWidth = 160 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
[General] | ||
DqmColorMap = 56 | ||
DqmColorMap = 54 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// -*- mode: c -*- | ||
|
||
#ifndef AHCALCOLLECTION_HH_ | ||
#define AHCALCOLLECTION_HH_ | ||
// ROOT Includes | ||
#include <RQ_OBJECT.h> | ||
#include <TH2I.h> | ||
#include <TFile.h> | ||
|
||
// STL includes | ||
#include <string> | ||
#include <vector> | ||
#include <algorithm> | ||
#include <map> | ||
#include <iostream> | ||
|
||
#include "eudaq/StandardEvent.hh" | ||
|
||
// Project Includes | ||
#include "SimpleStandardEvent.hh" | ||
#include "AhcalHistos.hh" | ||
#include "BaseCollection.hh" | ||
|
||
class AhcalCollection : public BaseCollection { | ||
RQ_OBJECT("AhcalCollection") | ||
protected: | ||
bool isOnePlaneRegistered; | ||
std::map<eudaq::StandardPlane, AhcalHistos *> _map; | ||
bool isPlaneRegistered(eudaq::StandardPlane p); | ||
void fillHistograms(const eudaq::StandardPlane &plane); | ||
|
||
public: | ||
void registerPlane(const eudaq::StandardPlane &p); | ||
void bookHistograms(const eudaq::StandardEvent &ev); | ||
void setRootMonitor(RootMonitor *mon) { _mon = mon; } | ||
AhcalCollection() : BaseCollection() { | ||
std::cout << " Initialising Ahcal Collection" << std::endl; | ||
isOnePlaneRegistered = false; | ||
CollectionType = AHCAL_COLLECTION_TYPE; | ||
} | ||
void Fill(const SimpleStandardEvent &simpev) { ; }; | ||
void Fill(const eudaq::StandardEvent &ev); | ||
AhcalHistos *getAhcalHistos(std::string sensor, int id); | ||
void Reset(); | ||
virtual void Write(TFile *file); | ||
virtual void Calculate(const unsigned int currentEventNumber); | ||
}; | ||
|
||
#ifdef __CINT__ | ||
#pragma link C++ class AhcalCollection - ; | ||
#endif | ||
|
||
#endif /* AHCALCOLLECTION_HH_ */ |
Oops, something went wrong.