// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
void AggregateCopyPropagation::AddToKillSet(Instruction* instr, 
                                            BitVector& killSet,
                                            BitVector& copySet) {
    // Check if the instruction could write to the destination
    // or source operand of the copy/set operation.
    // Only 'store' and 'call' instructions can write to memory.
    if((instr->IsStore() || instr->IsCall()) == false) {
        return;
    }

    // Analyze each copy/set operation found until now.
    // If the destination or source operands might be written
    // by this instruction then we add its Id to the kill set.
    for(int i = 0; i < infoList_.Count(); i++) {
        auto& copyInfo = infoList_[i];

        if(MightWriteToOperand(instr, copyInfo.Destination)) {
            SetBit(killSet, copyInfo.Index);
            ResetBit(copySet, copyInfo.Index);
        }
        else if(copyInfo.IsCopy && (copyInfo.IsFromConstant == false)) {
            if(MightWriteToOperand(instr, copyInfo.Source)) {
                SetBit(killSet, copyInfo.Index);
                ResetBit(copySet, copyInfo.Index);
            }
        }
    }
}
Beispiel #2
0
void KVIDCsI::Initialize()
{
   // Override default initialization method
   // If telescope has 1 CsI detector and at least 1 grid
   // then it is ready to identify particles, after we initialise
   // the grid

   if (GetDetectors()->GetEntries() == 1 && GetDetector(1)->IsType("CsI") && GetIDGrid()) {
      GetIDGrid()->Initialize();
      SetBit(kReadyForID);
   }
   else
      ResetBit(kReadyForID);
}
Beispiel #3
0
void KVIDCsI::Initialize()
{
   // Initialisation of telescope before identification.
   // This method MUST be called once before any identification is attempted.
   // Initialisation of grid is performed here.
   // IsReadyForID() will return kTRUE if a grid is associated to this telescope for the current run.

   CsIGrid = (KVIDGCsI *) GetIDGrid();
	fCsI = GetDetector(1);
   if( CsIGrid ) {
      CsIGrid->Initialize();
      SetBit(kReadyForID);
   }
   else
      ResetBit(kReadyForID);
}
Beispiel #4
0
void KVIDChIoCorrCsI::Initialize()
{
    // Initialize telescope for current run.

	fChIo = 0;
    fChIo = (KVChIo *) GetDetector(1);

	fCsI = 0;
    fCsI = (KVCsI *) GetDetector(2);

    fGrid = 0;
    fGrid = (KVIDZAGrid*) GetIDGrid();

    if (fChIo && fCsI && fGrid) {
        fGrid->Initialize();
        fGrid->SetOnlyZId(kTRUE);
        SetBit(kReadyForID);
    }
	else ResetBit(kReadyForID);

}
void KVIDSiLiCsI_camp5::Initialize()
{
   // Initialize telescope for current run.
   // Pointers to grids for run are set, and if there is at least 1 (GG) grid,
   // we set IsReadyForID = kTRUE

   fSiLi = GetDetector(1);
   fCsI = GetDetector(2);
   fGGgrid = fPGgrid = 0;
   TIter next(fIDGrids);
   KVIDGrid* grid = 0;
   while ((grid = (KVIDGrid*)next())) {
      if (!strcmp(grid->GetVarY(), "SILI_GG")) fGGgrid = (KVIDZAGrid*)grid;
      else if (!strcmp(grid->GetVarY(), "SILI_PG")) fPGgrid = (KVIDZAGrid*)grid;
   }
   if (fGGgrid) {
      SetBit(kReadyForID);
      fGGgrid->Initialize();
      if (fPGgrid) fPGgrid->Initialize();
   } else
      ResetBit(kReadyForID);
}
void KVIDChIoCsI_camp5::Initialize()
{
   // Initialize telescope for current run.
   // If there is at least 1 grid, we set fCanIdentify = kTRUE
   // "Natural" line widths are calculated for KVIDZAGrids.

   fChIo = (KVChIo*) GetDetector(1);
   fCsI = (KVCsI*) GetDetector(2);
   fCsIRPedestal = fCsI->GetPedestal("R");
   fCsILPedestal = fCsI->GetPedestal("L");
   fGGgrid = fPGgrid = 0;
   TIter next(GetListOfIDGrids());
   KVIDGraph* grid;
   while ((grid = (KVIDGraph*)next())) {
      if (!strcmp(grid->GetVarY(), "CHIO-GG")) fGGgrid = (KVIDZAGrid*)grid;
      else if (!strcmp(grid->GetVarY(), "CHIO-PG")) fPGgrid = (KVIDZAGrid*)grid;
   }
   if (fGGgrid) {
      SetBit(kReadyForID);
      fGGgrid->Initialize();
      if (fPGgrid) fPGgrid->Initialize();
   } else ResetBit(kReadyForID);
}
Beispiel #7
0
void KVHarpeeSi::Initialize()
{
   // Initialize the data members. Called by KVVAMOS::Initialize().
   fSiForPosition = NULL;
   ResetBit(kPosIsOK);
}