Changeset 12210 for trunk/FACT++


Ignore:
Timestamp:
10/20/11 01:14:57 (13 years ago)
Author:
tbretz
Message:
Debuged to make it work.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/ratescan.cc

    r12203 r12210  
    128128                return;
    129129
    130             if (fCounter<0 || fStatusFTM.second!=FTM::kTakingData)
     130            if (fCounter<0/* || fStatusFTM.second!=FTM::kTakingData*/)
    131131                return;
    132132
    133133            const FTM::DimTriggerRates &sdata = *static_cast<FTM::DimTriggerRates*>(curr->getData());
    134134
    135             if (fSeconds++<0)
     135            if (++fSeconds<0)
    136136                return;
    137137
     
    168168                sout2 << float(fTriggersPatch[i])/fSeconds << " ";
    169169            sout3 << fSeconds << " ";
    170             sout3 << float(sdata.fOnTimeCounter-fOnTimeStart)/fSeconds;
     170            sout3 << float(sdata.fOnTimeCounter-fOnTimeStart)/fSeconds/1000000;
    171171
    172172            cout << sout1.str() << sout3.str() << endl;
     
    178178
    179179            fCounter++;
    180             fSeconds = -2;
    181 
    182             if (fThresholdMin+fCounter*fThresholdStep>fThresholdMax)
     180
     181            if (fSeconds>=fSecondsMax || fThresholdMin+fCounter*fThresholdStep>fThresholdMax)
    183182            {
    184183                fCounter = -1;
    185                 DimClient::sendCommandNB("FTM_CONTROL/STOP_RUN", NULL, 0);
     184                cout << "The END" << endl;
     185                //DimClient::sendCommandNB("FTM_CONTROL/STOP_RUN", NULL, 0);
    186186                return;
    187187            }
     188
     189            fSeconds = -2;  // FIXME: In principle one missed report is enough
    188190
    189191            const int32_t data[2] = { -1, fThresholdMin+fCounter*fThresholdStep };
     
    223225
    224226        Message("Starting Trigger (FTM)");
    225         Dim::SendCommand("FTM_CONTROL/SET_PRESCALING", int32_t(0));
     227        Dim::SendCommand("FTM_CONTROL/SET_PRESCALING", int32_t(20));
    226228        Dim::SendCommand("FTM_CONTROL/SET_THRESHOLD", data);
    227         Dim::SendCommand("FTM_CONTROL/START_RUN");
     229        //Dim::SendCommand("FTM_CONTROL/STOP_RUN");
    228230
    229231        fCounter = 0;
     
    237239        fCounter = -1;
    238240
    239         if (fStatusFTM.second==FTM::kTakingData)
     241        //if (fStatusFTM.second==FTM::kTakingData)
    240242        {
    241243            Message("Stopping FTM");
    242             Dim::SendCommand("FTM_CONTROL/STOP_RUN");
     244            //Dim::SendCommand("FTM_CONTROL/STOP_RUN");
    243245        }
    244246
     
    273275        fDim("DIS_DNS/VERSION_NUMBER",  (void*)NULL, 0, this),
    274276        fFTM("FTM_CONTROL/STATE",       (void*)NULL, 0, this),
    275         fRates("FTM_CONTROL/TRIGGER_RATES", (void*)NULL, 0, this)
     277        fRates("FTM_CONTROL/TRIGGER_RATES", (void*)NULL, 0, this),
     278        fCounter(-1)
    276279    {
    277280        // ba::io_service::work is a kind of keep_alive for the loop.
     
    355358        }*/
    356359
    357         fThresholdMin  = 100;
    358         fThresholdMax  = 1000;
    359         fThresholdStep = 25;
     360        fThresholdMin  = 0;
     361        fThresholdMax  = 100;
     362        fThresholdStep = 1;
     363
    360364        fSecondsMax    = 150;
    361365        fResolution    = 0.05;
Note: See TracChangeset for help on using the changeset viewer.