Changeset 6567


Ignore:
Timestamp:
02/17/05 15:37:12 (20 years ago)
Author:
moralejo
Message:
Corrected bug in the setting of the trigger patterns. It turns out that
in the current data format, MRawRunHeader.fFormatVersion=5, as of
February 2005, the trigger bits are "inverted" ( 0 <-> 1 ) in their meaning
(see Mars/mtrigger/MTriggerPattern).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Simulation/Detector/Camera/camera.cxx

    r6560 r6567  
    12061206
    12071207  RunHeader->SetMagicNumber(MRawRunHeader::kMagicNumber);
     1208
     1209  //
     1210  // We set as format version 5, the current real data version as of February 2005.
     1211  // These data have the peculiarity that the trigger pattern bits
     1212  // (MRawEventHeader.fTrigPattern[0]) will be inverted (0 <-> 1) with respect
     1213  // to the definitions in Mars/mtrigger/MTriggerPattern. We will account for this
     1214  // below when setting the trigger pattern.
     1215  //
    12081216  RunHeader->SetFormatVersion(5);
     1217
     1218
    12091219  RunHeader->SetSoftVersion((UShort_t) (VERSION*10));
    12101220  RunHeader->SetRunType(256);
     
    20852095            }
    20862096         
    2087           }// end if(simulateNSB && inumphe_CT[0] >= nphe2NSB) ...
     2097          }// end if(simulateNSB && inumphe >= nphe2NSB) ...
    20882098
    20892099
     
    22922302                                    EvtHeader[iconcount]->
    22932303                                      FillHeader( (UInt_t) (ntshow + nshow),0);
     2304
     2305                                    // Set trigger pattern. WARNING: the trigger pattern of real
     2306                                    // data is inverted for the MRawRunHeader.fFormatVersion=5
     2307                                    // which is the one we now set in the camera outputs. Hence
     2308                                    /// we use the binary inversion operator "~" below:
     2309
    22942310                                    EvtHeader[iconcount]->
    2295                                       SetTriggerPattern((UInt_t)MTriggerPattern::kTriggerLvl1);
     2311                                      SetTriggerPattern((UInt_t)~MTriggerPattern::kTriggerLvl1);
     2312
    22962313                                    //   fill pixel information
    2297                                     if (Lev1 /*|| Write_All_Event_Headers AMTEST*/){
     2314                                    if (Lev1){
    22982315                                      if (addElecNoise) Fadc_CT[0]->DigitalNoise();
    22992316                                      for(UInt_t i=0;
     
    25642581                EvtHeader[ict]
    25652582                  ->FillHeader ( (UInt_t) (ntshow + nshow) , 0 ) ;
    2566                 EvtHeader[ict]->SetTriggerPattern((UInt_t)MTriggerPattern::kTriggerLvl1);
     2583
     2584
     2585                // Set trigger pattern. WARNING: the trigger pattern of real
     2586                // data is inverted for the MRawRunHeader.fFormatVersion=5
     2587                // which is the one we now set in the camera outputs. Hence
     2588                /// we use the binary inversion operator "~" below:
     2589                EvtHeader[ict]->SetTriggerPattern((UInt_t)~MTriggerPattern::kTriggerLvl1);
    25672590
    25682591                // Fill pixel information
     
    47534776          if (phot_per_pix > 1.e-3)
    47544777            {
    4755               EvtHeader[ict]->SetTriggerPattern((UInt_t)(MTriggerPattern::kCalibration |
    4756               MTriggerPattern::kTriggerLvl1));
     4778              // Set trigger pattern. WARNING: the trigger pattern of real
     4779              // data is inverted for the MRawRunHeader.fFormatVersion=5
     4780              // which is the one we now set in the camera outputs. Hence
     4781              // we use the binary inversion operators "~" below. The Calibration
     4782              // pattern, on the contrary, is not inverted.
     4783              EvtHeader[ict]->SetTriggerPattern((UInt_t)(~(MTriggerPattern::kCalibration |
     4784              MTriggerPattern::kTriggerLvl1)));
    47574785              //
    47584786              // FIXME! For now color and intensity of the pulser is fixed!
     
    47604788            }
    47614789          else  // 0 cal. photons per pixel ==> pedestal run
    4762             EvtHeader[ict]->SetTriggerPattern((UInt_t)MTriggerPattern::kPedestal);
     4790            EvtHeader[ict]->SetTriggerPattern((UInt_t)~MTriggerPattern::kPedestal);
    47634791
    47644792
     
    50315059//
    50325060// $Log: not supported by cvs2svn $
     5061// Revision 1.89  2005/02/17 09:15:28  moralejo
     5062//
     5063// Set as default option that of writing all event headers to output file,
     5064// not only those of the triggered events. To disable it, set the input card
     5065// flag "no_write_all_event_headers".
     5066//
     5067// Changed such that output images for events below the minimum number of
     5068// photoelectrons nphe2NSB required to simulate the noise (NSB & electronic)
     5069// will be empty. This will avoid the problem of these events being processed,
     5070// without any noise, later in the chain. Although those images are not in the
     5071// output, one can still check in the headers (MMcTrig) how many such events
     5072// with less than nphe2NSB photoelectrons would have triggered.
     5073//
    50335074// Revision 1.88  2005/02/11 20:00:01  moralejo
    50345075//
Note: See TracChangeset for help on using the changeset viewer.