Bool_t KVReconstructedEvent::AnalyseDetectors(TList * kvtl) { // Loop over detectors in list // if any detector has fired, start construction of new detected particle // More precisely: If detector has fired, // making sure fired detector hasn't already been used to reconstruct // a particle, then we create and fill a new detected particle. // In order to avoid creating spurious particles when reading data, // by default we ask that ALL coder values be non-zero here i.e. data and time-marker. // This can be changed by calling SetPartSeedCond("any"): in this case, // particles will be reconstructed starting from detectors with at least 1 fired parameter. KVDetector *d; TIter next(kvtl); while( (d = (KVDetector*)next()) ){ /* If detector has fired, making sure fired detector hasn't already been used to reconstruct a particle, then we create and fill a new detected particle. */ if ( (d->Fired( fPartSeedCond.Data() ) && !d->IsAnalysed()) ) { KVReconstructedNucleus *kvdp = AddParticle(); //add all active detector layers in front of this one //to the detected particle's list kvdp->Reconstruct(d); //set detector state so it will not be used again d->SetAnalysed(kTRUE); } } return kTRUE; }
void KVReconstructedEvent::CalibrateEvent() { // Calculate and set energies of all identified particles in event. // // This will call the KVReconstructedNucleus::Calibrate() method of each // uncalibrated particle (those for which KVReconstructedNucleus::IsCalibrated() // returns kFALSE). // // In order to make sure that target energy loss corrections are correctly // calculated, we first set the state of the target in the current multidetector KVTarget* t = gMultiDetArray->GetTarget(); if(t){ t->SetIncoming(kFALSE); t->SetOutgoing(kTRUE); } KVReconstructedNucleus *d; while ((d = GetNextParticle())) { if (d->IsIdentified() && !d->IsCalibrated()){ d->Calibrate(); } } }
bool KVINDRABackwardGroupReconstructor::DoCoherencyAnalysis(KVReconstructedNucleus& PART) { // Coherency analysis for backward rings 10-17 of INDRA PART.SetParameter("UseFullChIoEnergyForCalib", !(theChio && theChio->GetNHits() > 1)); bool ok = false; if (PART.GetStoppingDetector()->IsType("CSI")) { // particles stopping in CsI detectors // check coherency of CsI-R/L and Si-CsI identifications ok = CoherencyChIoCsI(PART); } else { // particle stopped in ChIo (=> Zmin) ok = PART.IsIdentified() && identifying_telescope; } return ok; }
void KVFAZIARawDataReconstructor::ExtraProcessing() { KVString label = ""; KVFAZIADetector* det = 0; KVSignal* sig = 0; KVReconstructedNucleus* recnuc = 0; while ((recnuc = recev->GetNextParticle())) { TIter next_d(recnuc->GetDetectorList()); while ((det = (KVFAZIADetector*)next_d())) { TIter next_s(det->GetListOfSignals()); while ((sig = (KVSignal*)next_s())) { if (sig->HasFPGA()) { for (Int_t ii = 0; ii < sig->GetNFPGAValues(); ii += 1) { //SI2-T3-Q1-B003.Q2.RawAmplitude=14 if (ii == 0) label = "FPGAEnergy"; if (ii == 1) label = "FPGAFastEnergy"; //only for CsI Q3 TString ene = GetEvent()->GetFPGAEnergy( det->GetBlockNumber(), det->GetQuartetNumber(), det->GetTelescopeNumber(), sig->GetType(), ii ); recnuc->GetParameters()->SetValue( Form("%s.%s.%s", det->GetName(), sig->GetName(), label.Data()), ene.Data() ); } } if (!sig->PSAHasBeenComputed()) { sig->TreateSignal(); } KVNameValueList* psa = sig->GetPSAResult(); if (psa) { *(recnuc->GetParameters()) += *psa; delete psa; } } } } }
void KVReconstructedEvent::Print(Option_t * option) const { //Print out list of particles in the event. //If option="ok" only particles with IsOK=kTRUE are included. cout << " ***//*** RECONSTRUCTED EVENT #" << GetNumber() << " ***//***" << endl; cout << GetTitle() << endl; //system cout << GetName() << endl; //run cout << "MULTIPLICITY = " << ((KVReconstructedEvent *) this)-> GetMult(option) << endl << endl; KVReconstructedNucleus *frag = 0; int i=0; while ((frag = ((KVReconstructedEvent *) this)->GetNextParticle(option))) { cout << "RECONSTRUCTED PARTICLE #" << ++i << endl; frag->Print(); cout << endl; } }
void KVReconstructedEvent::Streamer(TBuffer & R__b) { //Stream an object of class KVReconstructedEvent. //We set the particles' angles depending on whether mean or random angles //are wanted (fMeanAngles = kTRUE or kFALSE) if (R__b.IsReading()) { R__b.ReadClassBuffer(KVReconstructedEvent::Class(), this); // if the multidetector object exists, update some informations // concerning the detectors etc. hit by this particle if ( gMultiDetArray ){ //set angles KVReconstructedNucleus *par; while ((par = GetNextParticle())) { if (HasMeanAngles()) par->GetAnglesFromStoppingDetector("mean"); else par->GetAnglesFromStoppingDetector("random"); //reconstruct fAnalStatus information for KVReconstructedNucleus if (par->GetStatus() == 99) //AnalStatus has not been set for particles in group if (par->GetGroup()) KVReconstructedNucleus::AnalyseParticlesInGroup( par->GetGroup() ); } } } else { R__b.WriteClassBuffer(KVReconstructedEvent::Class(), this); } }
bool KVINDRAEtalonGroupReconstructor::DoCoherencyAnalysis(KVReconstructedNucleus& PART) { // Coherency analysis for etalon groups on rings 10-17 of INDRA // Note that the treatment of all modules in the group except the one with the etalons // is standard (KVINDRABackwardGroupReconstructor), but all modules will call here first if (!GetSi75(&PART) && !GetSiLi(&PART)) // => no etalons in particle trajectory return KVINDRABackwardGroupReconstructor::DoCoherencyAnalysis(PART); PART.SetParameter("UseFullChIoEnergyForCalib", !(theChio && theChio->GetNHits() > 1)); bool ok = CoherencyEtalons(PART); return ok; }
Bool_t KVINDRABackwardGroupReconstructor::CoherencyChIoCsI(KVReconstructedNucleus& PART) { // Called by Identify() for particles stopping in CsI detectors on rings 10-17, // which have a ChIo detector just in front of them. // // fPileupChIo = kTRUE if ChIo-CsI identification gives Z >> CsI-R/L identification // this means that the particle identified in CsI-R/L is correct, // and there is probably a second particle which stopped in the ChIo // detector at the same time (will be added as a Zmin/code5) KVIdentificationResult* IDcsi = PART.GetIdentificationResult(1); KVIdentificationResult* IDcicsi = PART.GetIdentificationResult(2); KVIDTelescope* idt_cicsi = (KVIDTelescope*)PART.GetReconstructionTrajectory()->GetIDTelescopes()->FindObjectByType(IDcicsi->GetType()); KVIDTelescope* idt_csi = (KVIDTelescope*)PART.GetReconstructionTrajectory()->GetIDTelescopes()->FindObjectByType(IDcsi->GetType()); PART.SetParameter("PileupChIo", kFALSE); // Unsuccessful/no CsI id attempt with successful ChIo-CsI id ? // Then use ChIo-CsI identification result if (IDcsi && !IDcsi->IDOK) { if (IDcicsi && IDcicsi->IDOK) { partID = *IDcicsi; identifying_telescope = idt_cicsi; return kTRUE; } } // check coherency of CsI-R/L and ChIo-CsI identifications if (IDcsi && IDcsi->IDOK) { // We check the coherency of the identifications // Because ChIo-Csi identification is not of very high quality (compared to CsI R-L), // we only check that the Z given by ChIo-CsI is < Zref+1 // If not, we can suspect the presence of another particle in the ChIo if (IDcicsi && IDcicsi->IDOK) { Int_t Zref = IDcsi->Z; if (IDcicsi->Z > (Zref + 1) && PART.GetParameters()->GetBoolValue("UseFullChIoEnergyForCalib")) { PART.SetParameter("PileupChIo", kTRUE); IDcicsi->SetComment("Possible pile-up in ChIo"); } } // in all other cases accept CsI identification partID = *IDcsi; identifying_telescope = idt_csi; return kTRUE; } return kFALSE; }
Bool_t KVINDRAEtalonGroupReconstructor::CoherencyEtalons(KVReconstructedNucleus& PART) { // Called by Identify() for particles stopping in etalon modules of Rings 10-17. KVIdentificationResult* IDcsi, *IDsilicsi, *IDsi75sili, *IDcisi75, *IDcicsi; IDcsi = IDsilicsi = IDsi75sili = IDcisi75 = IDcicsi = nullptr; if (PART.GetStoppingDetector()->IsType("CSI")) { IDcsi = PART.GetIdentificationResult("CSI_R_L"); IDcicsi = PART.GetIdentificationResult("CI_CSI"); IDsilicsi = PART.GetIdentificationResult("SILI_CSI"); } IDsi75sili = PART.GetIdentificationResult("SI75_SILI"); IDcisi75 = PART.GetIdentificationResult("CI_SI75"); PART.SetParameter("PileupChIo", kFALSE); PART.SetParameter("IncludeEtalonsInCalibration", kTRUE); Bool_t haveCsI = IDcsi && IDcsi->IDOK; Bool_t haveSiLiCsI = IDsilicsi && IDsilicsi->IDOK; Bool_t haveSi75SiLi = IDsi75sili && IDsi75sili->IDOK; Bool_t haveChIoSi75 = IDcisi75 && IDcisi75->IDOK; KVIDTelescope* idt_csi, *idt_silicsi, *idt_si75sili, *idt_cisi75, *idt_cicsi; idt_csi = idt_silicsi = idt_si75sili = idt_cisi75 = idt_cicsi = nullptr; if (PART.GetStoppingDetector()->IsType("CSI")) { idt_csi = (KVIDTelescope*)PART.GetReconstructionTrajectory()->GetIDTelescopes()->FindObjectByType(IDcsi->GetType()); idt_silicsi = (KVIDTelescope*)PART.GetReconstructionTrajectory()->GetIDTelescopes()->FindObjectByType(IDsilicsi->GetType()); idt_cicsi = (KVIDTelescope*)PART.GetReconstructionTrajectory()->GetIDTelescopes()->FindObjectByType(IDcicsi->GetType()); } idt_si75sili = (KVIDTelescope*)PART.GetReconstructionTrajectory()->GetIDTelescopes()->FindObjectByType(IDsi75sili->GetType()); idt_cisi75 = (KVIDTelescope*)PART.GetReconstructionTrajectory()->GetIDTelescopes()->FindObjectByType(IDcisi75->GetType()); // Treat cases where particle hit etalon telescope if (idt_csi) { if (haveCsI) { partID = *IDcsi; identifying_telescope = idt_csi; if (haveSi75SiLi) { // check for heavy fragment in Si75-SiLi if (IDsi75sili->Z > partID.Z) { if (haveChIoSi75) { // check we don't have a better identification in ChIo-Si75 if (IDcisi75->IDquality < IDsi75sili->IDquality && IDcisi75->Z > partID.Z) { PART.SetParameter("PileupSi75", kTRUE); IDcisi75->SetComment("CsI identification with another particle stopped in Si75"); PART.SetParameter("UseFullChIoEnergyForCalib", kFALSE); // calculate ChIo energy for this particle } else { PART.SetParameter("PileupSiLi", kTRUE); IDsi75sili->SetComment("CsI identification with another particle stopped in SiLi"); PART.SetParameter("UseFullChIoEnergyForCalib", kFALSE); // calculate ChIo energy for this particle } } } } else if (haveChIoSi75) { // check for heavy fragment in ChIo-Si75 if (IDcisi75->Z > partID.Z) { PART.SetParameter("PileupSi75", kTRUE); IDcisi75->SetComment("CsI identification with another particle stopped in Si75"); PART.SetParameter("UseFullChIoEnergyForCalib", kFALSE); // calculate ChIo energy for this particle } } return kTRUE; } else if (haveSiLiCsI) { partID = *IDsilicsi; identifying_telescope = idt_silicsi; if (haveChIoSi75) { // check for heavy fragment in ChIo-Si75 if (IDcisi75->Z > partID.Z) { PART.SetParameter("PileupSi75", kTRUE); IDcisi75->SetComment("CsI identification with another particle stopped in Si75"); PART.SetParameter("UseFullChIoEnergyForCalib", kFALSE); // calculate ChIo energy for this particle } } return kTRUE; } } else if (PART.GetStoppingDetector()->IsType("SILI")) { if (haveSi75SiLi) { partID = *IDsi75sili; identifying_telescope = idt_si75sili; // check ChIo-Si75 id is coherent (either no id or Z<=this one) if (haveChIoSi75) { if (IDcisi75->Z > partID.Z) PART.SetParameter("PileupChIo", kTRUE); } return kTRUE; } else if (haveChIoSi75) { partID = *IDcisi75; identifying_telescope = idt_cisi75; return kTRUE; } } else if (PART.GetStoppingDetector()->IsType("SI75")) { // MFR march 2014 SiLi is not the real stopping detector if (haveChIoSi75) { partID = *IDcisi75; identifying_telescope = idt_cisi75; return kTRUE; } // end MFR march 2014 } return kFALSE; }
void KVReconstructedEvent::IdentifyEvent() { //All particles which have not been previously identified (IsIdentified=kFALSE), and which //may be identified independently of all other particles in their group according to the 1st //order coherency analysis (KVReconstructedNucleus::GetStatus=0), will be identified. //Particles stopping in first member of a telescope (KVReconstructedNucleus::GetStatus=3) will //have their Z estimated from the energy loss in the detector (if calibrated). KVReconstructedNucleus *d; while ((d = GetNextParticle())) { if (!d->IsIdentified()){ if(d->GetStatus() == KVReconstructedNucleus::kStatusOK){ // identifiable particles d->Identify(); } else if(d->GetStatus() == KVReconstructedNucleus::kStatusStopFirstStage) { // particles stopped in first member of a telescope // estimation of Z (minimum) from energy loss (if detector is calibrated) UInt_t zmin = d->GetStoppingDetector()->FindZmin(-1., d->GetMassFormula()); if( zmin ){ d->SetZ( zmin ); d->SetIsIdentified(); // "Identifying" telescope is taken from list of ID telescopes // to which stopping detector belongs d->SetIdentifyingTelescope( (KVIDTelescope*)d->GetStoppingDetector()->GetIDTelescopes()->At(0) ); } } } } }
Bool_t ExampleFilteredSimDataAnalysis::Analysis() { // EVENT BY EVENT ANALYSIS // Reject events with less good particles than acquisition trigger for run if (!GetEvent()->IsOK()) return kTRUE; mult = GetEvent()->GetMult("ok"); // if we can access the events of the unfiltered simulation, read in the event corresponding // to the currently analysed reconstructed event if (link_to_unfiltered_simulation) GetFriendTreeEntry(GetEvent()->GetParameters()->GetIntValue("SIMEVENT_TREE_ENTRY")); for (int i = 0; i < mult; i++) { KVReconstructedNucleus* part = (KVReconstructedNucleus*)ZMAX->GetZmax(i); Z[i] = part->GetZ(); A[i] = part->GetA(); idcode[i] = part->GetIDCode(); ecode[i] = part->GetECode(); Ameasured[i] = part->IsAMeasured(); // Example for events filtered with FAZIA@INDRA set-up if (part->GetParameters()->GetTStringValue("ARRAY") == "INDRA") array[i] = 0; else if (part->GetParameters()->GetTStringValue("ARRAY") == "FAZIA") array[i] = 1; else array[i] = -1; Vper[i] = part->GetFrame("cm")->GetVperp(); Vpar[i] = part->GetFrame("cm")->GetVpar(); ELab[i] = part->GetEnergy(); ThetaLab[i] = part->GetTheta(); PhiLab[i] = part->GetPhi(); // if we can access the events of the unfiltered simulation, and if Gemini++ was used // to decay events before filtering, this is how you can access the "parent" nucleus // of the current detected decay product // KVSimNucleus* papa = (KVSimNucleus*)GetFriendEvent()->GetParticle( part->GetParameters()->GetIntValue("GEMINI_PARENT_INDEX") ); } GetGVList()->FillBranches(); FillTree(); return kTRUE; }