Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Muon veto #86

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions src/slave/CBV1724.cc
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ int CBV1724::Initialize(koOptions *options)

// Reload VME options
int tries = 0;
while( LoadVMEOptions( options ) != 0 && tries < 5) {
while( LoadVMEOptions( options, false ) != 0 && tries < 5) {
tries ++;
usleep(100);
if( tries == 5 )
Expand All @@ -160,6 +160,16 @@ int CBV1724::Initialize(koOptions *options)
fBufferOccCount = 0;
fReadoutReports.clear();

// Load user registers for boards with a unique ID only
// this is to avoid user settings to be overwritten
tries = 0;
while( LoadVMEOptions( options,true ) != 0 && tries < 5) {
tries ++;
usleep(100);
if( tries == 5 )
retVal = -1;
}

// Report whether we succeeded or not
stringstream messstr;
if( retVal == 0 ){
Expand Down Expand Up @@ -923,13 +933,17 @@ int CBV1724::LoadDAC(vector<int> baselines){
return 0;
}

int CBV1724::LoadVMEOptions( koOptions *options )
int CBV1724::LoadVMEOptions( koOptions *options, bool unique )
{
int retVal = 0;
// Reload VME options
for(int x=0;x<options->GetVMEOptions();x++) {
if((options->GetVMEOption(x).board==-1 ||
if( ( (options->GetVMEOption(x).board==-1 && unique == false) ||
options->GetVMEOption(x).board==fBID.id)){

// only reload registers for DAC
if( (options->GetVMEOption(x).address & 0x98)!=0x98)
continue;
int success = WriteReg32(options->GetVMEOption(x).address,
options->GetVMEOption(x).value);
if( options->GetVMEOption(x).address == 0xEF24 ) // give time to reset
Expand Down
2 changes: 1 addition & 1 deletion src/slave/CBV1724.hh
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class CBV1724 : public VMEBoard {
int LoadDAC(vector <int> baselines);
int LoadBaselines(); //Load baselines to boards
int GetBaselines(vector <int> &baselines, bool bQuiet=false); //Get baselines from file
int LoadVMEOptions( koOptions *options );
int LoadVMEOptions( koOptions *options, bool unique );

unsigned int fReadoutThresh;
pthread_mutex_t fDataLock;
Expand Down