<commit_before>// Functions to create/store/inspect TRD PID DB.
// 
// Author:
// <NAME> (<EMAIL>)
// 


//___________________________________________________________________
void makePIDRefs(const char *dir = ".", const char *file="Refs.root")
{
// Build the reference data for PID. The simulations have to fulfill
// the directory structure defined inside AliTRDCalPIDRefMaker.
// Parameters:
// 1. "dir" - the root directory of the production
// 2. "file" - output file containing reference data saved in directory
//             "dir" 

	AliCDBManager *man = AliCDBManager::Instance();
	man->SetDefaultStorage("local://$ALICE_ROOT");
	man->SetRun(0);

	AliTRDCalPIDRefMaker maker;
	maker.BuildLQReferences(file, dir);
}

//___________________________________________________________________
void generatePIDDB(const char *file = "Refs.root")
{
// Write TRD PID DB using the reference data from file "file"


	AliCDBManager *man = AliCDBManager::Instance();
	man->SetDefaultStorage("local://$ALICE_ROOT");
	man->SetRun(0);

	AliCDBStorage *gStorLoc = man->GetStorage("local://$ALICE_ROOT");
  if (!gStorLoc) return;

  
	AliTRDCalPIDLQ *pid = new AliTRDCalPIDLQ("pid", "TRD PID object");
	pid->LoadLQReferences(file);

	AliCDBMetaData *md= new AliCDBMetaData();
  md->SetObjectClassName("AliTRDCalPIDLQ");
  md->SetResponsible("<NAME>");
  md->SetBeamPeriod(1);
  md->SetAliRootVersion("v4-05-Release"); //root version
  md->SetComment("2D PID for TRD");

	gStorLoc->Put(pid, AliCDBId("TRD/Calib/PIDLQ", 0, 0), md);
}

//___________________________________________________________________
AliTRDCalPIDLQ* getPIDObject()
{
// Returns PIDLQ object.
// In order to browse histos do:
//   > AliTRDCalPIDLQ *pid = getPIDObject();
//   > pid->GetHistogram(0, 3);

	gStyle->SetOptStat(0);
	
  AliCDBManager *CDBManager = AliCDBManager::Instance();
	CDBManager->SetDefaultStorage("local://$ALICE_ROOT");
	CDBManager->SetRun(0);

	AliCDBEntry *wrap = CDBManager->Get("TRD/Calib/PIDLQ", 0);
	AliTRDCalPIDLQ *pid = dynamic_cast<const AliTRDCalPIDLQ *>wrap->GetObject();
	AliCDBMetaData *meta = wrap->GetMetaData();
	if(!pid){
		printf("Error while retriving pid object from DB.\n");
		return 0x0;
	}
	meta->PrintMetaData();
	return pid;
}
<commit_msg>Updated macro version by Alexandru<commit_after>// Functions to create/store/inspect TRD PID DB.
// 
// Author:
// <NAME> (<EMAIL>)
// 


//___________________________________________________________________
void makePIDRefs(const char *dir = ".", const char *file="Refs.root")
{
// Build the reference data for PID. The simulations have to fulfill
// the directory structure defined inside AliTRDCalPIDRefMaker.
// Parameters:
// 1. "dir" - the root directory of the production
// 2. "file" - output file containing reference data saved in directory
//             "dir" 

	AliCDBManager *man = AliCDBManager::Instance();
	man->SetDefaultStorage("local://$ALICE_ROOT");
	man->SetRun(0);

	AliTRDCalPIDRefMaker maker;
	maker.BuildLQReferences(file, dir);
}

//___________________________________________________________________
void generatePIDDB(const char *file = "Refs.root")
{
// Write TRD PID DB using the reference data from file "file"


	AliCDBManager *man = AliCDBManager::Instance();
	man->SetDefaultStorage("local://$ALICE_ROOT");
	man->SetRun(0);

	AliCDBStorage *gStorLoc = man->GetStorage("local://$ALICE_ROOT");
  if (!gStorLoc) return;

  
	AliTRDCalPID *pid = new AliTRDCalPID("pid", "TRD PID object");
	pid->LoadLQReferences(file);

	AliCDBMetaData *md= new AliCDBMetaData();
  md->SetObjectClassName("AliTRDCalPIDLQ");
  md->SetResponsible("<NAME>");
  md->SetBeamPeriod(1);
  md->SetAliRootVersion("v4-06-HEAD"); //root version
  md->SetComment("2D PID for TRD");

	gStorLoc->Put(pid, AliCDBId("TRD/Calib/PIDLQ", 0, 0), md);
}

//___________________________________________________________________
AliTRDCalPID* getPIDObject()
{
// Returns PIDLQ object.
// In order to browse histos do:
//   > AliTRDCalPID *pid = getPIDObject();
//   > pid->GetHistogram(0, 3);

	gStyle->SetOptStat(0);
	
  AliCDBManager *CDBManager = AliCDBManager::Instance();
	CDBManager->SetDefaultStorage("local://$ALICE_ROOT");
	CDBManager->SetRun(0);

	AliCDBEntry *wrap = CDBManager->Get("TRD/Calib/PIDLQ", 0);
	AliTRDCalPID *pid = dynamic_cast<const AliTRDCalPID *>wrap->GetObject();
	AliCDBMetaData *meta = wrap->GetMetaData();
	if(!pid){
		printf("Error while retriving pid object from DB.\n");
		return 0x0;
	}
	meta->PrintMetaData();
	return pid;
}

{'fraction_non_alphanumeric': 0.1464826357969724, 'fraction_numerical': 0.008014247551202136, 'mean_word_length': 4.966799468791501, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 55, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2327193', 'n_tokens_mistral': 1560, 'n_tokens_neox': 1461, 'n_words': 332}