X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=EMCAL%2FAliEMCALTriggerData.cxx;h=835cdec3b2c801fc16c287627f76295f584ee1cb;hb=2c80cbde3588014fafeeb830ae89f9898e30402a;hp=31f3577130a5e1242471bcd1c12466f04790e750;hpb=521ea43e8b0b7e33fd44d326744daaaa5caa4cb5;p=u%2Fmrichter%2FAliRoot.git diff --git a/EMCAL/AliEMCALTriggerData.cxx b/EMCAL/AliEMCALTriggerData.cxx index 31f3577130a..835cdec3b2c 100644 --- a/EMCAL/AliEMCALTriggerData.cxx +++ b/EMCAL/AliEMCALTriggerData.cxx @@ -32,235 +32,43 @@ ClassImp(AliEMCALTriggerData) //_____________ AliEMCALTriggerData::AliEMCALTriggerData() : TObject(), fMode(0), -fL0Patches(), -fL0Region(), -fL1GammaPatches(), -fL1JetPatches(), -fL1Region(), -fL1GammaThreshold(0), -fL1JetThreshold(0), +fL1GammaThreshold(), +fL1JetThreshold(), fL1V0(), fL1FrameMask(0), fL1TriggerType(), -fL1DataDecoded(0) +fL1DataDecoded(0), +fL1RawData(0) { - // - for (Int_t i = 0; i < 2; i++) - { - fL0Patches[i] = new TClonesArray("AliEMCALTriggerPatch"); - fL1GammaPatches[i] = new TClonesArray("AliEMCALTriggerPatch"); - fL1JetPatches[i] = new TClonesArray("AliEMCALTriggerPatch"); - } - - for (Int_t i = 0; i < 32; i++) for (Int_t j = 0; j < 24; j++) for (Int_t k = 0; k < 4; k++) fL0Region[i][j][k] = 0; - for (Int_t i = 0; i < 2; i++) for (Int_t j = 0; j < 48; j++) for (Int_t k = 0; k < 64; k++) fL1Region[i][j][k] = 0; + // Ctor + + fL1GammaThreshold[0] = fL1GammaThreshold[1] = 0; + fL1JetThreshold[0] = fL1JetThreshold[1] = 0; fL1V0[0] = fL1V0[1] = 0; - for (Int_t i = 0; i < 8; i++) fL1TriggerType[i] = 0; + for (Int_t i = 0; i < 15; i++) fL1TriggerType[i] = 0; } //_____________ AliEMCALTriggerData::~AliEMCALTriggerData() { - // - for (Int_t i = 0; i < 2; i++) - { - if ( fL0Patches[i]) fL0Patches[i]->Delete(); - if (fL1GammaPatches[i]) fL1GammaPatches[i]->Delete(); - if ( fL1JetPatches[i]) fL1JetPatches[i]->Delete(); - } -} - -//_____________ -void AliEMCALTriggerData::SetL0Region(Int_t i, const Int_t**& region) -{ - // - if (i < 0 || i > 31) - { - AliError("Bad index!"); - return; - } - - for (Int_t j=0;j<24;j++) - for (Int_t k=0;k<4;k++) fL0Region[i][j][k] = region[j][k]; -} - -//_____________ -void AliEMCALTriggerData::GetPatches(TriggerType_t type, Int_t i, TClonesArray& patches) const -{ - // - if (i < 0 || i > 1) - { - AliError("Bad index!"); - return; - } - - switch (type) - { - case kL0: - patches = *fL0Patches[i]; - break; - case kL1Gamma: - patches = *fL1GammaPatches[i]; - break; - case kL1Jet: - patches = *fL1JetPatches[i]; - break; - default: - AliError("Unknown trigger type!"); - break; - } -} - -//_____________ -TClonesArray* AliEMCALTriggerData::GetPatches(TriggerType_t type, Int_t i) const -{ - // - if (i < 0 || i > 1) - { - AliError("Bad index!"); - return 0x0; - } - - switch (type) - { - case kL0: - return fL0Patches[i]; - break; - case kL1Gamma: - return fL1GammaPatches[i]; - break; - case kL1Jet: - return fL1JetPatches[i]; - break; - default: - AliError("Unknown trigger type!"); - break; - } - - return 0x0; -} - -//_____________ -void AliEMCALTriggerData::SetPatches(TriggerType_t type, Int_t i, const TClonesArray& patches) -{ - // - if (i < 0 || i > 1) - { - AliError("Bad index!"); - return; - } - - if (patches.GetEntriesFast()) - { - TClonesArray* arr = 0x0; - - switch (type) - { - case kL0: - arr = fL0Patches[i]; - break; - case kL1Gamma: - arr = fL1GammaPatches[i]; - break; - case kL1Jet: - arr = fL1JetPatches[i]; - break; - default: - AliError("Unknown trigger type!"); - return; - } - - if (arr) - { - Int_t size = arr->GetSize() + patches.GetSize(); - - arr->Expand(size); - - for (Int_t k = 0; k < patches.GetEntriesFast(); k++) - { - AliEMCALTriggerPatch* p = static_cast(patches.At(k)); - new((*arr)[arr->GetEntriesFast()]) AliEMCALTriggerPatch(*p); - } - } - else - { - AliError("TClonesArray is NULL!"); - } - } + // Dtor } -//_____________ -void AliEMCALTriggerData::SetL1Region(Int_t i, Int_t**& region) -{ - // - if (i < 0 || i > 1) - { - AliError("Bad index!"); - return; - } - - for (Int_t j = 0; j < 48; j++) - for (Int_t k = 0; k < 64; k++) fL1Region[i][j][k] = region[j][k]; -} - -//_____________ -void AliEMCALTriggerData::GetL1Region(Int_t i, Int_t arr[][64]) const -{ - // - if (i < 0 || i > 1) - { - AliError("Bad index!"); - return; - } - - for (Int_t j = 0; j < 48; j++) for (Int_t k = 0; k < 64; k++) { arr[j][k] = fL1Region[i][j][k]; } -} - - //_____________ void AliEMCALTriggerData::Scan() const { - // - TIterator* nP; + // Dump - printf("L0:\n"); - printf("\tFound (%2d,%2d) patches\n", fL0Patches[1]->GetEntriesFast(), fL0Patches[0]->GetEntriesFast()); - printf("\tRAW:\n"); - nP = fL0Patches[1]->MakeIterator(); - while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");} - printf("\tREC:\n"); - nP = fL0Patches[0]->MakeIterator(); - while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");} - printf("L1:\n"); - printf("\tFound (%4d,%4d) gamma patches\n",fL1GammaPatches[1]->GetEntriesFast(), fL1GammaPatches[0]->GetEntriesFast()); - printf("\tRAW:\n"); - nP = fL1GammaPatches[1]->MakeIterator(); - while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");} - printf("\tREC:\n"); - nP = fL1GammaPatches[0]->MakeIterator(); - while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");} - printf("\tFound (%4d,%4d) jet patches\n",fL1JetPatches[1]->GetEntriesFast(), fL1JetPatches[0]->GetEntriesFast()); - printf("\tRAW:\n"); - nP = fL1JetPatches[1]->MakeIterator(); - while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");} - printf("\tREC:\n"); - nP = fL1JetPatches[0]->MakeIterator(); - while (AliEMCALTriggerPatch* p = (AliEMCALTriggerPatch*)nP->Next()) {printf("\t"); p->Print("");} + for (int i = 0; i < 2; i++){ + printf("\tL1 thresholds[%d]: gamma %d\tjet %d\n", i, fL1GammaThreshold[i], fL1JetThreshold[i]); + } } //_____________ void AliEMCALTriggerData::Reset() { - // - for (Int_t i = 0; i < 2; i++) - { - if ( fL0Patches[i]) fL0Patches[i]->Delete(); - if (fL1GammaPatches[i]) fL1GammaPatches[i]->Delete(); - if ( fL1JetPatches[i]) fL1JetPatches[i]->Delete(); - } - - for (Int_t i = 0; i < 2; i++) for (Int_t j = 0; j < 48; j++) for (Int_t k = 0; k < 64; k++) fL1Region[i][j][k] = 0; + // Reset fL1DataDecoded = 0; }