本文整理汇总了C++中KVACQParam类的典型用法代码示例。如果您正苦于以下问题:C++ KVACQParam类的具体用法?C++ KVACQParam怎么用?C++ KVACQParam使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了KVACQParam类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FillFiredParameterList
Bool_t KVGANILDataReader::GetNextEvent()
{
// Read next event in raw data file.
// Returns false if no event found (end of file).
// The list of all fired acquisition parameters is filled, and can be retrieved with
// GetFiredDataParameters().
// If SetUserTree(TTree*) has been called, the TTree is filled with the values of all
// parameters in this event.
Bool_t ok = fGanilData->Next();
FillFiredParameterList();
if( fUserTree ){
if( make_arrays ){
NbParFired = fFired->GetEntries();
TIter next(fFired); KVACQParam* par;
int i=0;
while( (par = (KVACQParam*)next()) ){
ParVal[i] = par->GetCoderData();
ParNum[i] = par->GetNumber();
i++;
}
}
fUserTree->Fill();
}
return ok;
}
示例2: TTree
void KVINDRAPulserDataTree::CreateTree()
{
// Create new TTree with
// 1 branch 'Run' with run number
// 1 branch for each acquisition parameter of every detector (except time markers)
// 2 branches for each 'PILA_...' or 'SI_PIN...' parameter, suffixed with '_laser' and '_gene'
//
// NB if multidetector has not been built, it will be built by this method
fArb = new TTree("PulserData", "Created by KVINDRAPulserDataTree");
fArb->SetDirectory(0);
fArb->Branch("Run", &fRun, "Run/I");
if (!gIndra) KVMultiDetArray::MakeMultiDetector(gDataSet->GetName());
KVSeqCollection* acq_pars = gIndra->GetACQParams();
fTab_siz = acq_pars->GetEntries() + 20;
fVal = new Float_t[fTab_siz];
fIndex = new THashTable(20, 5);
fIndex->SetOwner(kTRUE);
TIter nxtACQ(acq_pars);
KVACQParam* ap = 0;
Int_t ap_num = 0;
KVBase* iob;
while ((ap = (KVACQParam*)nxtACQ())) {
TString ap_name(ap->GetName());
TString ap_type(ap->GetType());
if (ap_name.BeginsWith("PILA") || ap_name.BeginsWith("SI_PIN")) {
ap_name += "_laser";
iob = new KVBase(ap_name.Data());
iob->SetNumber(ap_num);
fIndex->Add(iob);
fArb->Branch(ap_name.Data(), &fVal[ap_num++] , Form("%s/F", ap_name.Data()));
ap_name.Form("%s%s", ap->GetName(), "_gene");
iob = new KVBase(ap_name.Data());
iob->SetNumber(ap_num);
fIndex->Add(iob);
fArb->Branch(ap_name.Data(), &fVal[ap_num++] , Form("%s/F", ap_name.Data()));
} else if (ap_type != "T") {
iob = new KVBase(ap_name.Data());
iob->SetNumber(ap_num);
fIndex->Add(iob);
fArb->Branch(ap_name.Data(), &fVal[ap_num++] , Form("%s/F", ap_name.Data()));
}
if (ap_num > fTab_siz - 2) {
Error("CreateTree",
"Number of branches to create is greater than estimated (%d). Not all parameters can be treated.",
fTab_siz);
return;
}
}
//keep number of used 'slots' in array
fTab_siz = ap_num;
}
示例3: next
void KVGANILDataReader::FillFiredParameterList()
{
// clears and then fills list fFired with all fired acquisition parameters in event
fFired->Clear();
TIter next(fParameters);
KVACQParam *par;
while( (par = (KVACQParam*)next()) ) if(par->Fired()) fFired->Add(par);
}
示例4: GetT
Float_t KVVAMOSDetector::GetT(const Char_t* type)
{
// Returns the coder value of a time acquisition parameter (in channel)
// of type 'type' (SED_HF, SI_HF, SI_SED1, ...).
// A time signal is always associated to an object KVVAMOS pointed by
// gVamos, then gVamos has to be different to zero. If gVamos is null
// or type is not correct, this method returns -1;
if (!IsStartForT(type) || !gVamos) return -1;
KVACQParam* par = gVamos->GetACQParam(Form("T%s", type));
return (par ? par->GetData() : -1);
}
示例5: SetACQParams
void KVHarpeeSi::SetACQParams(){
// Setup the energy acquisition parameter for this silicon detector.
// This parameter has the name of the detector and has the type 'E'
// (for energy).
//
KVACQParam *par = new KVACQParam;
par->SetName( GetEBaseName() );
par->SetType("E");
par->SetNumber( GetNumber() );
par->SetUniqueID( CalculateUniqueID( par ) );
AddACQParam(par);
}
示例6: KVList
void KVSiliconVamos::SetACQParams()
{
// Add an acquisition parameter to this detector
if (!fACQParams) {
fACQParams = new KVList();
}
// creer parametre d'acquisition avec meme nom que le detecteur
KVACQParam* par = new KVACQParam(GetName());
par->SetDetector(this);
par->SetType("E");
fACQParams->Add(par);
}
示例7: next
KVList *KVSpectroDetector::GetFiredACQParamList(Option_t *opt){
// Returns a list with all the fired acquisiton parameters of
// this detector. The option is set to the method KVACQParam::Fired;
//
// *** WARNING *** : DELETE the list returned by this method after using it !!!
TIter next( GetACQParamList() );
KVACQParam *par = NULL;
KVList *list = new KVList( kFALSE );
while( (par = (KVACQParam *)next()) ){
if( par->Fired( opt ) ) list->Add( par );
}
return list;
}
示例8: KVList
void KVBIC::AddACQParam(const Char_t* type)
{
//Add an acquisition parameter of given type to this detector
//The parameters for the BIC in blocking telescopes 1, 2, and 3
//were called CI_1601_x, CI_1602_x, and CI_1603_x respectively,
//so here we have to override the KVDetector default behaviour.
if (!fACQParams)
fACQParams = new KVList();
KVACQParam* par = new KVACQParam();
TString name;
name.Form("CI_16%02d_%s", GetTelescope()->GetNumber(), type);
par->SetName(name);
par->SetDetector(this);
par->SetType(type);
fACQParams->Add(par);
}
示例9: Error
void KVINDRAUpDater_e475s::SetCalibrationParameters(UInt_t run){
//Set calibration parameters for this run.
//This will:
// remove all the calibrators of all the detectors ready to receive the calibrators for the run (handled by child classes),
// set calibration parameters for the run
// set pedestals for the run
cout << "Setting calibration parameters of INDRA array for run " << run << ":" <<
endl;
KVDBRun *kvrun = gIndraDB->GetRun(run);
if (!kvrun)
{
Error("SetParameters(UInt_t)", "Run %u not found in database!", run);
return;
}
//Reset all calibrators of all detectors first
TIter next(gIndra->GetListOfDetectors());
KVDetector *kvd;
while ((kvd = (KVDetector *) next()))
{
if (kvd->InheritsFrom("KVSiLi") || kvd->InheritsFrom("KVSi75")){
if (kvd->GetListOfCalibrators())
kvd->RemoveCalibrators();
kvd->SetCalibrators();
}
else {
if (kvd->GetListOfCalibrators())
{
kvd->RemoveCalibrators();
TIter lacq(kvd->GetACQParamList());
KVACQParam* acq = 0;
while ( (acq = (KVACQParam* )lacq()) ){
acq->SetPedestal(0);
}
}
}
}
SetCalibParameters(kvrun);
SetPedestals(kvrun);
}
示例10: next_csi
void KVINDRAUpDater::SetCsIGainCorrectionParameters(KVDBRun* kvrun)
{
// Sets KVCsI::fGainCorrection data member, used by KVCsI::GetCorrectedLumiereTotale
// to return the total light output corrected by a run-dependent factor.
// We set all detectors' correction to 1, then set the corrections defined for this
// run, if any.
TIter next_csi(GetINDRA()->GetListOfCsI());
KVCsI* csi;
while ((csi = (KVCsI*)next_csi())) {
csi->SetTotalLightGainCorrection(1.0);
}
KVRList* param_list = kvrun->GetLinks("CsIGainCorr");
if (!param_list) {
return;
}
if (!param_list->GetSize()) {
return;
}
TIter next_ps(param_list);
KVDBParameterSet* dbps;
while ((dbps = (KVDBParameterSet*)next_ps())) {
csi = (KVCsI*)fArray->GetDetector(dbps->GetName());
if (!csi) {
// the name of the parameter set should be the name of the detector;
// however, it may be the name of an acquisition parameter associated with
// the detector!
KVACQParam* a = fArray->GetACQParam(dbps->GetName());
if (a) csi = (KVCsI*)a->GetDetector();
// still no good ?
if (!csi) {
Warning("SetCsIGainCorrectionParameters",
"Cannot find detector associated with %s", dbps->GetName());
continue;
}
}
csi->SetTotalLightGainCorrection(dbps->GetParameter());
Info("SetCsIGainCorrectionParameters", "%s gain correction = %f", csi->GetName(), csi->GetTotalLightGainCorrection());
}
}
示例11: CheckACQParam
KVACQParam* KVGANILDataReader::CheckACQParam( const Char_t* par_name )
{
//Check the named acquisition parameter.
//We look for a corresponding parameter in the list of acq params belonging to
//the current KVMultiDetArray (if one exists).
//If none is found, we create a new acq param which is added to the list of "unknown parameters"
KVACQParam *par;
if( !gMultiDetArray || !(par = gMultiDetArray->GetACQParam( par_name )) ){
//create new unknown parameter
par = new KVACQParam;
par->SetName( par_name );
if(!fExtParams){
fExtParams=new KVHashList;
fExtParams->SetOwner(kTRUE);
}
fExtParams->Add( par );
}
return par;
}
示例12: next
UInt_t KVHarpeeIC::GetFiredSegNumber(Option_t* opt)
{
// return the number of the fired segment of this Harpee ionisation chamber
// ( number between 1 to 7 ). Returns 0 if no segment or several segments
// are fired. A segment is considered as fired if at least one of its 3
// acquisition parameters (A, B and C) is fired (KVACQParam::Fired( opt )).
// Set the option opt = "P" to accept only the acquisition parameters with
// their value above the pedestal.
TIter next(GetACQParamList());
KVACQParam* par = NULL;
UInt_t num = 0;
while ((par = (KVACQParam*)next())) {
if (par->Fired(opt)) {
if (num && (num != par->GetNumber())) return 0;
num = par->GetNumber();
}
}
return num;
}
示例13: preAnalysis
void KVINDRAReconDataAnalyser::preAnalysis()
{
// Read and set raw data for the current reconstructed event
// Any required data patches ("rustines") are applied.
if(!theRawData) return;
// all recon events are numbered 1, 2, ... : therefore entry number is N-1
Long64_t rawEntry = fSelector->GetEventNumber() - 1;
gIndra->GetACQParams()->R__FOR_EACH(KVACQParam,Clear)();
theRawData->GetEntry(rawEntry);
for(int i=0; i<NbParFired; i++){
KVACQParam* par = gIndra->GetACQParam((*parList)[ParNum[i]]->GetName());
if(par) {par->SetData(ParVal[i]);}
}
// as rustines often depend on a knowledge of the original raw data,
// we apply them after it has been read in
if(fRustines.HasActivePatches()) fRustines.Apply(fSelector->GetEvent());
}
示例14: SetACQParams
void KVHarpeeIC::SetACQParams()
{
// Setup acquisition parameters of this ionisation chamber.
// ACQ parameters with type 'E':
// E[detector type]_[A,B,C]_[detector number]
//
// WARNING: actually only the acquisition parameters with indice 'A'
// are defined ('B' and 'C' were not coded in e494s and e503 experiment ).
TString name;
Char_t idx[] = {'A', 'B', 'C'};
for (Int_t num = 1; num <= ARPEEIC_NSEG; num++) {
// for(Int_t i = 0; i<3; i++){
for (Int_t i = 0; i < 1; i++) {
KVACQParam* par = new KVACQParam;
name.Form("E%s_%c_%d", GetType(), idx[i], num);
par->SetName(name);
par->SetType("E");
par->SetLabel(Form("%c", idx[i]));
par->SetNumber(num);
par->SetUniqueID(CalculateUniqueID(par));
AddACQParam(par);
}
}
}
示例15: str
Int_t KVSpectroDetector::GetMult(Option_t *opt){
// Returns the multiplicity of fired (value above the pedestal)
// acquisition parameters if opt = "" (default).
// If opt = "root" returns the multiplicity of only fired acq.
// parameters with GetName() containing "root". For example if
// you want the multiplicity of fired segments B of a child class
// KVHarpeeIC call GetMult("ECHI_B").
Int_t mult = 0;
TString str( opt );
Bool_t withroot = !str.IsNull();
TIter next( GetACQParamList() );
KVACQParam *par = NULL;
while( (par = (KVACQParam *)next()) ){
if( withroot ){
str = par->GetName();
if( !str.Contains( opt ) ) continue;
}
if( par->Fired("P") ) mult++;
}
return mult;
}