当前位置: 首页>>代码示例>>C++>>正文


C++ Info函数代码示例

本文整理汇总了C++中Info函数的典型用法代码示例。如果您正苦于以下问题:C++ Info函数的具体用法?C++ Info怎么用?C++ Info使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了Info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: Info

RECT DisplayManager::Rect(HMONITOR monitor) {
    return Info(monitor).rcMonitor;
}
开发者ID:malensek,项目名称:3RVX,代码行数:3,代码来源:DisplayManager.cpp

示例2: fErr

//AwaitInput
bool Menu::AwaitInput (wstring *psKey)
{
    Err fErr (m_Err, L"AwaitInput");
    if (psKey == NULL)
    {
        return fErr.Set (sERR_ARGUMENTS);
    }
    psKey->clear ();

    wstring sInfo;
    if (!m_pLanguage->Get (L"KeyInfo", &sInfo))
    {
        return false;
    }

    Key MouseUp, MouseDown, MouseLeft, MouseRight;
    if (!MouseUp.Init (&m_Err, m_pWindow, sMOUSE_UP, false) ||
        !MouseDown.Init (&m_Err, m_pWindow, sMOUSE_DOWN, false) ||
        !MouseLeft.Init (&m_Err, m_pWindow, sMOUSE_LEFT, false) ||
        !MouseRight.Init (&m_Err, m_pWindow, sMOUSE_RIGHT, false))
    {
        return false;
    }

    while (psKey->empty () && !m_bClose)
    {
        sf::Event Event;
        while (m_pWindow->GetEvent (Event))
        {
            switch (Event.Type)
            {
                case (sf::Event::Closed):
                    m_bClose = true;
                    break;
                case (sf::Event::KeyPressed):
                    if (Event.Key.Code == sf::Key::Escape)
                    {
                        return true;
                    }
                    *psKey = Key::GetInputName (*m_pWindow, Event.Key.Code);
                    break;
                case (sf::Event::MouseButtonPressed):
                    *psKey = Key::GetInputName (*m_pWindow, Event.Key.Code,
                                                Key::eMouse);
                    break;
                case (sf::Event::MouseMoved):
                    if (MouseDown.IsPressed ())
                    {
                        *psKey = sMOUSE_DOWN;
                    }
                    if (MouseUp.IsPressed ())
                    {
                        *psKey = sMOUSE_UP;
                    }
                    if (MouseLeft.IsPressed ())
                    {
                        *psKey = sMOUSE_LEFT;
                    }
                    if (MouseRight.IsPressed ())
                    {
                        *psKey = sMOUSE_RIGHT;
                    }
                    break;
                default:
                    break;
            }
        }

        m_pWindow->Clear ();

        sf::String Info (sInfo, sf::Font::GetDefaultFont ());
        Info.SetCenter (Info.GetRect ().GetWidth () / 2,
                        Info.GetRect ().GetHeight () / 2);
        Info.SetPosition (500, 400);
        Draw (Info);

        m_pWindow->Display ();

        MouseUp.ResetMouse ();
        MouseDown.ResetMouse ();
        MouseLeft.ResetMouse ();
        MouseRight.ResetMouse ();

        sf::Sleep (nSLEEPTIME);
    }

    return true;
}//AwaitInput
开发者ID:3dik,项目名称:MPong,代码行数:89,代码来源:Menu.cpp

示例3: fin


//.........这里部分代码省略.........

   // The output filename
   TString fout(fnf);
   if (!fout.IsNull()) {
      sameFile = kFALSE;
      openMain = "READ";
      // Make sure the directory exists
      TString dir = gSystem->DirName(fout);
      if (gSystem->AccessPathName(dir, kWritePermission)) {
         if (gSystem->mkdir(dir, kTRUE) != 0) {
            Error("GenerateFriend", "problems creating directory %s to store the file", dir.Data());
            return rc;
         }
      }
   } else {
      // We set the same name
      fout = fin;
   }

   // Get main tree
   TFile *fi = TFile::Open(fin, openMain);
   if (!fi || fi->IsZombie()) {
      Error("GenerateFriend", "problems opening input file %s", fin.Data());
      return rc;
   }
   TTree *Tin = (TTree *) fi->Get("Tmain");
   if (!Tin) {
      Error("GenerateFriend", "problems getting tree 'Tmain' from file %s", fin.Data());
      delete fi;
      return rc;
   }
   // Set branches
   Float_t x, y, z;
   Tin->SetBranchAddress("x", &x);
   Tin->SetBranchAddress("y", &y);
   Tin->SetBranchAddress("z", &z);
   TBranch *b_x = Tin->GetBranch("x");
   TBranch *b_y = Tin->GetBranch("y");
   TBranch *b_z = Tin->GetBranch("z");

   TDirectory* savedir = gDirectory;
   // Create output file
   TFile *fo = 0;
   if (!sameFile) {
      fo = new TFile(fout, "RECREATE");
      if (!fo || fo->IsZombie()) {
         Error("GenerateFriend", "problems opening file %s", fout.Data());
         delete fi;
         return rc;
      }
      savedir->cd();
   } else {
      // Same file
      fo = fi;
   }
   rc = 0;

   // Create the tree
   TTree *Tfrnd = new TTree("Tfrnd", "Friend tree for tutorial 'friends'");
   Tfrnd->SetDirectory(fo);
   Float_t r = 0;
   Tfrnd->Branch("r",&r,"r/F");
   Long64_t ent = Tin->GetEntries();
   for (Long64_t i = 0; i < ent; i++) {
      b_x->GetEntry(i);
      b_y->GetEntry(i);
      b_z->GetEntry(i);
      r = TMath::Sqrt(x*x + y*y + z*z);
      Tfrnd->Fill();
   }
   if (!sameFile) {
      fi->Close();
      delete fi;
   }
   Tfrnd->Print();
   fo->cd();
   Tfrnd->Write();
   Tfrnd->SetDirectory(0);
   fo->Close();
   delete fo;
   delete Tfrnd;

   // Notify success
   Info("GenerateFriend", "friend file '%s' successfully created", fout.Data());

   // Add to the list
   TUrl uu(fout);
   if (!strcmp(uu.GetProtocol(), "file")) {
      if (gSystem->Getenv("LOCALDATASERVER")) {
         if (strcmp(TUrl(gSystem->Getenv("LOCALDATASERVER"), kTRUE).GetProtocol(), "file"))
            fout.Insert(0, TString::Format("%s/", gSystem->Getenv("LOCALDATASERVER")));
      } else {
         fout.Insert(0, TString::Format("root://%s/", gSystem->HostName()));
      }
   }
   fFriendList->Add(new TObjString(fout));

   // Done
   return rc;
}
开发者ID:gganis,项目名称:proof,代码行数:101,代码来源:ProofAux.C

示例4: Info

vcpu_t *create_vcpu(vm_t *vm, unsigned int entry_point, unsigned int arg, char* stack_pointer, uint32_t pip, uint32_t ostype){	
	static uint32_t vcpu_id=1;
	static uint32_t shadow_gpr_to_assign = 0;
	uint32_t num_shadow_gprs;
	
	vcpu_t *ret;
	ll_node_t *nd;

	Info("Creating VCPUs");
        
	if(!(nd = (ll_node_t *) calloc(1, sizeof(vcpu_t)+sizeof(ll_node_t))))
		return NULL;

	ret = (vcpu_t*)((unsigned int)nd + sizeof(ll_node_t));
	
	memset(ret, 0, sizeof(vcpu_t));

	//Set vcpu id and gprshadowset
	//ret->gprshadowset = vcpu_id;
	
	num_shadow_gprs = hal_lr_srsclt();
	num_shadow_gprs = (num_shadow_gprs & SRSCTL_HSS) >> SRSCTL_HSS_SHIFT;
	
    if (ostype == IDLEVCPU){
        ret->gprshadowset = num_shadow_gprs;
    }else
        //Highest shadown gpr is used to 
        if(shadow_gpr_to_assign==num_shadow_gprs){
            ret->gprshadowset=shadow_gpr_to_assign-1;
        }else{
            ret->gprshadowset = shadow_gpr_to_assign;
            shadow_gpr_to_assign++;
        }
	
	ret->pip = pip;
    if (ostype == IDLEVCPU){
        ret->id = 0;  
    }else{
        ret->id = vcpu_id;	
        vcpu_id++;
    }
	
	//Not initialized
	ret->init=1;

	/* initilize the VCPU cp0 registers with the guest cp0 status */
	contextSave(ret);
	
	/* Initialize compare and count registers. */
	ret->cp0_registers[9][0] = 0;
	ret->cp0_registers[11][0] = 0;
		
	ret->pc  = entry_point;
	ret->sp  = (uint32_t)stack_pointer;
		
	ret->arg = arg;
		
	//Vm pointer
	ret->vm = vm;
		
	//Adding to local list of vm's vcpus
	nd->ptr = ret;
	ll_append(&(vm->vcpus), nd);

        return ret;
}
开发者ID:pierpaolobagnasco,项目名称:prpl-hypervisor,代码行数:66,代码来源:vm.c

示例5: scanner

TypeParser::Info TypeParser::parse(const QString &str)
{
    Scanner scanner(str);

    Info info;
    QStack<Info *> stack;
    stack.push(&info);

    bool colon_prefix = false;
    bool in_array = false;
    QString array;

    Scanner::Token tok = scanner.nextToken();
    while (tok != Scanner::NoToken) {

//         switch (tok) {
//         case Scanner::StarToken: printf(" - *\n"); break;
//         case Scanner::AmpersandToken: printf(" - &\n"); break;
//         case Scanner::LessThanToken: printf(" - <\n"); break;
//         case Scanner::GreaterThanToken: printf(" - >\n"); break;
//         case Scanner::ColonToken: printf(" - ::\n"); break;
//         case Scanner::CommaToken: printf(" - ,\n"); break;
//         case Scanner::ConstToken: printf(" - const\n"); break;
//         case Scanner::SquareBegin: printf(" - [\n"); break;
//         case Scanner::SquareEnd: printf(" - ]\n"); break;
//         case Scanner::Identifier: printf(" - '%s'\n", qPrintable(scanner.identifier())); break;
//         default:
//             break;
//         }

        switch (tok) {

        case Scanner::StarToken:
            ++stack.top()->indirections;
            break;

        case Scanner::AmpersandToken:
            stack.top()->is_reference = true;
            break;

        case Scanner::LessThanToken:
            stack.top()->template_instantiations << Info();
            stack.push(&stack.top()->template_instantiations.last());
            break;

        case Scanner::CommaToken:
            stack.pop();
            stack.top()->template_instantiations << Info();
            stack.push(&stack.top()->template_instantiations.last());
            break;

        case Scanner::GreaterThanToken:
            stack.pop();
            break;

        case Scanner::ColonToken:
            colon_prefix = true;
            break;

        case Scanner::ConstToken:
            stack.top()->is_constant = true;
            break;

        case Scanner::OpenParenToken: // function pointers not supported
        case Scanner::CloseParenToken:
            {
                Info i;
                i.is_busted = true;
                return i;
            }


        case Scanner::Identifier:
            if (in_array) {
                array = scanner.identifier();
            } else if (colon_prefix || stack.top()->qualified_name.isEmpty()) {
                stack.top()->qualified_name << scanner.identifier();
                colon_prefix = false;
            } else {
                stack.top()->qualified_name.last().append(" " + scanner.identifier());
            }
            break;

        case Scanner::SquareBegin:
            in_array = true;
            break;

        case Scanner::SquareEnd:
            in_array = false;
            stack.top()->arrays += array;
            break;


        default:
            break;
        }

        tok = scanner.nextToken();
    }

//.........这里部分代码省略.........
开发者ID:FrankLIKE,项目名称:qtd,代码行数:101,代码来源:typeparser.cpp

示例6: main

int main()
{
    Info() << "hello";
}
开发者ID:CCJY,项目名称:coliru,代码行数:4,代码来源:main.cpp

示例7: _xioopen_proxy_connect

int _xioopen_proxy_connect(struct single *xfd,
			   struct proxyvars *proxyvars,
			   int level) {
   size_t offset;
   char request[CONNLEN];
   char buff[BUFLEN+1];
#if CONNLEN > BUFLEN
#error not enough buffer space 
#endif
   char textbuff[2*BUFLEN+1];	/* just for sanitizing print data */
   char *eol = buff;
   int state;
   ssize_t sresult;

   /* generate proxy request header - points to final target */
   sprintf(request, "CONNECT %s:%u HTTP/1.0\r\n",
	   proxyvars->targetaddr, proxyvars->targetport);

   /* send proxy CONNECT request (target addr+port) */
   * xiosanitize(request, strlen(request), textbuff) = '\0';
   Info1("sending \"%s\"", textbuff);
   /* write errors are assumed to always be hard errors, no retry */
   do {
      sresult = Write(xfd->wfd, request, strlen(request));
   } while (sresult < 0 && errno == EINTR);
   if (sresult < 0) {
      Msg4(level, "write(%d, %p, "F_Zu"): %s",
	   xfd->wfd, request, strlen(request), strerror(errno));
      if (Close(xfd->wfd) < 0) {
	 Info2("close(%d): %s", xfd->wfd, strerror(errno));
      }
      return STAT_RETRYLATER;
   }

   if (proxyvars->authstring) {
      /* send proxy authentication header */
#     define XIOAUTHHEAD "Proxy-authorization: Basic "
#     define XIOAUTHLEN  27
      static const char *authhead = XIOAUTHHEAD;
#     define HEADLEN 256
      char *header, *next;

      /* ...\r\n\0 */
      if ((header =
	   Malloc(XIOAUTHLEN+((strlen(proxyvars->authstring)+2)/3)*4+3))
	  == NULL) {
	 return -1;
      }
      strcpy(header, authhead);
      next = xiob64encodeline(proxyvars->authstring,
			      strlen(proxyvars->authstring),
			      strchr(header, '\0'));
      *next = '\0';
      Info1("sending \"%s\\r\\n\"", header);
      *next++ = '\r';  *next++ = '\n'; *next++ = '\0';
      do {
	 sresult = Write(xfd->wfd, header, strlen(header));
      } while (sresult < 0 && errno == EINTR);
      if (sresult < 0) {
	 Msg4(level, "write(%d, %p, "F_Zu"): %s",
	      xfd->wfd, header, strlen(header), strerror(errno));
	 if (Close(xfd->wfd/*!*/) < 0) {
	    Info2("close(%d): %s", xfd->wfd, strerror(errno));
	 }
	 return STAT_RETRYLATER;
      }

      free(header);
   }

   Info("sending \"\\r\\n\"");
   do {
      sresult = Write(xfd->wfd, "\r\n", 2);
   } while (sresult < 0 && errno == EINTR);
   /*! */

   /* request is kept for later error messages */
   *strstr(request, " HTTP") = '\0';

   /* receive proxy answer; looks like "HTTP/1.0 200 .*\r\nHeaders..\r\n\r\n" */
   /* socat version 1 depends on a valid fd for data transfer; address
      therefore cannot buffer data. So, to prevent reading beyond the end of
      the answer headers, only single bytes are read. puh. */
   state = XIOSTATE_HTTP1;
   offset = 0;	/* up to where the buffer is filled (relative) */
   /*eol;*/	/* points to the first lineterm of the current line */
   do {
      sresult = xioproxy_recvbytes(xfd, buff+offset, 1, level);
      if (sresult <= 0) {
	 state = XIOSTATE_ERROR;
	 break;	/* leave read cycles */
      }
      
      switch (state) {

      case XIOSTATE_HTTP1:
	 /* 0 or more bytes of first line received, no '\r' yet */
	 if (*(buff+offset) == '\r') {
	    eol = buff+offset;
	    state = XIOSTATE_HTTP2;
//.........这里部分代码省略.........
开发者ID:dest-unreach,项目名称:socat2,代码行数:101,代码来源:xio-proxy.c

示例8: PrivateAddActor

/**
* Creates an actor using the specified factory.  
*
* Does nothing if ActorClass is NULL.
*/
static AActor* PrivateAddActor( UObject* Asset, UActorFactory* Factory, bool SelectActor = true, EObjectFlags ObjectFlags = RF_Transactional, const FName Name = NAME_None )
{
	if (!Factory)
	{
		return nullptr;
	}

	AActor* Actor = NULL;
	AActor* NewActorTemplate = Factory->GetDefaultActor( Asset );
	if ( !NewActorTemplate )
	{
		return nullptr;
	}

	// For Brushes/Volumes, use the default brush as the template rather than the factory default actor
	if (NewActorTemplate->IsA(ABrush::StaticClass()) && GWorld->GetDefaultBrush() != nullptr)
	{
		NewActorTemplate = GWorld->GetDefaultBrush();
	}

	const FSnappedPositioningData PositioningData = FSnappedPositioningData(GCurrentLevelEditingViewportClient, GEditor->ClickLocation, GEditor->ClickPlane)
		.UseFactory(Factory)
		.UseStartTransform(NewActorTemplate->GetTransform())
		.UsePlacementExtent(NewActorTemplate->GetPlacementExtent());

	const FTransform ActorTransform = FActorPositioning::GetSnappedSurfaceAlignedTransform(PositioningData);

	// Do not fade snapping indicators over time if the viewport is not realtime
	bool bClearImmediately = !GCurrentLevelEditingViewportClient || !GCurrentLevelEditingViewportClient->IsRealtime();
	FSnappingUtils::ClearSnappingHelpers( bClearImmediately );

	ULevel* DesiredLevel = GWorld->GetCurrentLevel();

	// Don't spawn the actor if the current level is locked.
	if ( FLevelUtils::IsLevelLocked(DesiredLevel) )
	{
		FNotificationInfo Info( NSLOCTEXT("UnrealEd", "Error_OperationDisallowedOnLockedLevel", "The requested operation could not be completed because the level is locked.") );
		Info.ExpireDuration = 3.0f;
		FSlateNotificationManager::Get().AddNotification(Info);
		return nullptr;
	}

	{
		FScopedTransaction Transaction( NSLOCTEXT("UnrealEd", "CreateActor", "Create Actor") );
		if ( !(ObjectFlags & RF_Transactional) )
		{
			Transaction.Cancel();
		}

		// Create the actor.
		Actor = Factory->CreateActor( Asset, DesiredLevel, ActorTransform, ObjectFlags, Name );
		if(Actor)
		{
			if ( SelectActor )
			{
				GEditor->SelectNone( false, true );
				GEditor->SelectActor( Actor, true, true );
			}

			Actor->InvalidateLightingCache();
			Actor->PostEditChange();
		}
	}

	GEditor->RedrawLevelEditingViewports();

	if ( Actor )
	{
		Actor->MarkPackageDirty();
		ULevel::LevelDirtiedEvent.Broadcast();
	}

	return Actor;
}
开发者ID:PickUpSU,项目名称:UnrealEngine4,代码行数:79,代码来源:AssetSelection.cpp

示例9: runNorm

void runNorm(TString inputFileName = "AliAOD.root", Int_t nEvents = 1e6, TString beamConf = "p-Pb", Bool_t isESD = kFALSE, Bool_t isMC = kFALSE, Int_t debugLevel = 0)
{

  TStopwatch timer;
  timer.Start();
  
  // Check runing mode
  Int_t mode = GetMode(inputFileName);
  if(mode < 0){
    Error("runAnalysis","Please provide either an ESD/AOD root file or a collection of ESDs/AODs.");
    return;
  }
  
  // Load common libraries
  gSystem->Load("libTree");
  gSystem->Load("libGeom");
  gSystem->Load("libVMC");
  gSystem->Load("libPhysics");
  gSystem->Load("libSTEERBase");
  //  gSystem->Load("libSTEER");
  gSystem->Load("libESD");
  gSystem->Load("libAOD");
  gSystem->Load("libANALYSIS");
  gSystem->Load("libANALYSISalice");
  gSystem->Load("libEventMixing");
  gSystem->Load("libCORRFW");
  gSystem->Load("libPWGmuon"); 
  gSystem->Load("libPWGmuondep"); 
  
  gSystem->AddIncludePath(Form("-I\"%s/include\" -I\"%s/include\"", gSystem->ExpandPathName("$ALICE_ROOT"),gSystem->ExpandPathName("$ALICE_PHYSICS")));
  gROOT->ProcessLine(Form(".include %s/include %s/include", gSystem->ExpandPathName("$ALICE_ROOT"), gSystem->ExpandPathName("$ALICE_PHYSICS")));

  // Create input chain
  TChain* chain = CreateChain(inputFileName,isESD);
  if (!chain) return;
  
  // Create the analysis manager
  AliAnalysisManager *mgr = new AliAnalysisManager("MuonTask");
  
  if ( isESD) {
    // ESD input handler
    AliESDInputHandler* esdH = new AliESDInputHandler();
    esdH->SetReadFriends(kFALSE);
    mgr->SetInputEventHandler(esdH);
  }
  else {
    // AOD input handler
    AliAODInputHandler* aodH = new AliAODInputHandler();
    mgr->SetInputEventHandler(aodH);
  }

  TString dataType = mgr->GetInputEventHandler()->GetDataType();
  Info("runLocal",Form("Manager with %s",dataType.Data()));

 // Enable MC event handler for ESDs
  if ( isMC && isESD ){
    AliVEventHandler* handler = new AliMCEventHandler;
    mgr->SetMCtruthEventHandler(handler);
  }
  
  // event selection and centrality framework
  if ( isESD ){
    gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskPhysicsSelection.C");
    AliPhysicsSelectionTask* physicsSelection = AddTaskPhysicsSelection(isMC);
    if ( !physicsSelection ) {
      Error("runLocal","AliPhysicsSelectionTask not created!");
      return;
    }
  }
  if ( isESD ){
    // event centrality
    gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskCentrality.C");
    AliCentralitySelectionTask *taskCentrality = AddTaskCentrality();
    if ( !taskCentrality ) {
      Error("runLocal on ESD","AliCentralitySelectionTask not created!");
      return;
    }
    if ( isMC ) taskCentrality->SetMCInput();     
    //taskCentrality->SetPass(1); // remember to set the pass you are processing!!!
  }
  /*else {
    //Only on full AOD, it is possible to reprocess the centrality framework
    gROOT->LoadMacro("$ALICE_PHYSICS/OADB/macros/AddTaskCentrality.C");
    AliCentralitySelectionTask *taskCentrality = AddTaskCentrality(kTRUE,kTRUE);
    if ( !taskCentrality ) {
      Error("runLocal on AOD","AliCentralitySelectionTask not created!");
      return;
    }
    if ( isMC ) taskCentrality->SetMCInput();    
    }*/
  
  // Example analysis
  // Create task
  //Analysis task is on working directory
  //  gROOT->LoadMacro("AliAnalysisTaskNorm.cxx+g");
  //  gROOT->LoadMacro("AddTaskNorm.C");
  gROOT->LoadMacro("$ALICE_PHYSICS/../src/PWG/muon/AliAnalysisTaskNorm.cxx+g");
  gROOT->LoadMacro("$ALICE_PHYSICS/../src/PWG/muon/AddTaskNorm.C");
  AliAnalysisTaskNorm* task = AddTaskNorm(isESD,isMC,beamConf);
  if (!task) {
//.........这里部分代码省略.........
开发者ID:ktf,项目名称:AliPhysics,代码行数:101,代码来源:runNorm.C

示例10: CheckDone

void CheckDone(typePos *Position, int d)
    {
    sint64 x;
    if (!RootBestMove)
        return;
    if (IvanAllHalt)
        {
        HaltSearch(d, 1);
        return;
        }
    if (SuppressInput)
        return;
    if (!JumpIsSet)
        return;
    x = GetClock() - StartClock;
    if (d && d == Depth)
        {
        HaltSearch(d, 1);
        return;
        }
    if (x - LastMessage > 1000000)
        Info(x);
    if (DoPonder)
        goto End;
    if (DoInfinite)
        goto End;
    if (d >= 1 && d < 8)
        goto End;
    if (x > AbsoluteTime)
        {
        HaltSearch(d, 1);
        return;
        }
    if (d == 0 && !NewPonderhit)
        goto End;
    NewPonderhit = false;

    if (!BadMove && x >= BattleTime)
        {
        HaltSearch(d, 2);
        return;
        }
    if (EasyMove && x >= EasyTime)
        {
        HaltSearch(d, 3);
        return;
        }
    if (!BattleMove && x >= NormalTime && !BadMove)
        {
        HaltSearch(d, 4);
        return;
        }
    End:
    if (d)
        return;
    while (TryInput())
        {
        Input(Position);
        if (d == 0 && !SMPisActive)
            return;
        }
    }
开发者ID:ZirconiumX,项目名称:Firenzina,代码行数:62,代码来源:control.c

示例11: CheckSmearedESD


//.........这里部分代码省略.........
      if (v0Mother < 0) continue;
      Int_t bacLabel = TMath::Abs(esd->GetTrack(cascade->GetBindex())
				  ->GetLabel());
      if (bacLabel > stack->GetNtrack()) continue;     // background

      Int_t bacMother = stack->Particle(bacLabel)->GetMother(0);
      if (v0Mother != bacMother) continue;
      TParticle* particle = stack->Particle(v0Mother);
      if (!selCascades.Contains(particle)) continue;
      selCascades.Remove(particle);
      nRecCascades++;
    }

    // loop over the clusters

    {
      for (Int_t iCluster=0; iCluster<esd->GetNumberOfCaloClusters(); iCluster++) {
	AliESDCaloCluster * clust = esd->GetCaloCluster(iCluster);
	if (clust->IsPHOS()) hEPHOS->Fill(clust->E());
	if (clust->IsEMCAL()) hEEMCAL->Fill(clust->E());
      }
    }

  }

  // perform checks

  if (nGen < checkNGenLow) {
    Warning("CheckESD", "low number of generated particles: %d", Int_t(nGen));
  }

  TH1F* hEff = CreateEffHisto(hGen, hRec);

  Info("CheckESD", "%d out of %d tracks reconstructed including %d "
	 "fake tracks", nRec, nGen, nFake);
  if (nGen > 0) {
    // efficiency

    Double_t eff = nRec*1./nGen;
    Double_t effError = TMath::Sqrt(eff*(1.-eff) / nGen);
    Double_t fake = nFake*1./nGen;
    Double_t fakeError = TMath::Sqrt(fake*(1.-fake) / nGen);
    Info("CheckESD", "eff = (%.1f +- %.1f) %%  fake = (%.1f +- %.1f) %%",
	 100.*eff, 100.*effError, 100.*fake, 100.*fakeError);

		if(100.*eff<5.0){
			Error("CheckESD", "Efficiency too low!!!");return kFALSE;
		}
    if (eff < checkEffLow - checkEffSigma*effError) {
      Warning("CheckESD", "low efficiency: (%.1f +- %.1f) %%", 
	      100.*eff, 100.*effError);
    }
    if (fake > checkFakeHigh + checkFakeSigma*fakeError) {
      Warning("CheckESD", "high fake: (%.1f +- %.1f) %%", 
	      100.*fake, 100.*fakeError);
    }

    // resolutions

    Double_t res, resError;
    if (FitHisto(hResPtInv, res, resError)) {
      Info("CheckESD", "relative inverse pt resolution = (%.1f +- %.1f) %%",
	   res, resError);
      if (res > checkResPtInvHigh + checkResPtInvSigma*resError) {
	Warning("CheckESD", "bad pt resolution: (%.1f +- %.1f) %%", 
		res, resError);
开发者ID:alisw,项目名称:AliRoot,代码行数:67,代码来源:CheckSmearedESD.C

示例12: va_start

void Logger::Info(const char *message, ...) {
	va_list args;
	va_start(args, message);
	Info(message, args);
	va_end(args);
}
开发者ID:warrenlp,项目名称:Kartoshka,代码行数:6,代码来源:Logger.cpp

示例13: AddAnalysisManagerTestTask

void AddAnalysisManagerTestTask(TString analysisSource = "proof", TString analysisMode = "test", TString opts = "")
{

   Bool_t useMC = kFALSE;
   TString format = "esd";
   format = "aod";

   // ALICE stuff
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
   if (!mgr) mgr = new AliAnalysisManager("Martin Vala's AM");

   gROOT->LoadMacro("SetupAnalysisPlugin.C");
   AliAnalysisGrid *analysisPlugin = SetupAnalysisPlugin(analysisMode.Data());
   if (!analysisPlugin) return;

   // load par files localy
   gSystem->Load("libANALYSIS.so");
   gSystem->Load("libANALYSISalice.so");

   gROOT->LoadMacro("AliAnalysisTaskCustomMix.cxx+g");

   analysisPlugin->AddIncludePath(gSystem->ExpandPathName("$ALICE_ROOT/ANALYSIS/EventMixing"));
   analysisPlugin->SetAliRootMode("ALIROOT"); // Loads AF libs by default
   // sets additional settings to plubin
   analysisPlugin->SetAnalysisSource("AliAnalysisTaskCustomMix.cxx");
   analysisPlugin->SetAdditionalLibs("libEventMixing.so AliAnalysisTaskCustomMix.h AliAnalysisTaskCustomMix.cxx");

   // sets plugin to manager
   mgr->SetGridHandler(analysisPlugin);

   Info("AddAnalysisManagerMixRsn.C", "Creating AliMultiInputEventHandler ...");
   AliMultiInputEventHandler *mainInputHandler = new AliMultiInputEventHandler();
   Info("AddAnalysisManagerMixRsn.C", "Creating esdInputHandler ...");
   AliESDInputHandler *esdInputHandler = new AliESDInputHandler();
   mainInputHandler->AddInputEventHandler(esdInputHandler);

   if (useMC) {
      Info("AddAnalysisManagerMixRsn.C", "Creating mcInputHandler ...");
      AliMCEventHandler* mcInputHandler = new AliMCEventHandler();
      mainInputHandler->AddInputEventHandler(mcInputHandler);
   }

   Int_t bufferSize = 1;
   Int_t mixNum = 5;
   AliMixInputEventHandler *mixHandler = new AliMixInputEventHandler(bufferSize, mixNum);
   mixHandler->SetInputHandlerForMixing(dynamic_cast<AliMultiInputEventHandler*>(mainInputHandler));
   AliMixEventPool *evPool = new AliMixEventPool();


   AliMixEventCutObj *multi = new AliMixEventCutObj(AliMixEventCutObj::kMultiplicity, 1, 101, 10);
   AliMixEventCutObj *zvertex = new AliMixEventCutObj(AliMixEventCutObj::kZVertex, -5, 5, 1);

   evPool->AddCut(multi);
   evPool->AddCut(zvertex);

   // adds event pool (comment it and u will have default mixing)
   mixHandler->SetEventPool(evPool);

   //     add mixing handler (uncomment to turn on Mixnig)
   mainInputHandler->AddInputEventHandler(mixHandler);

   // add main input handler (with mixing handler)
   mgr->SetInputEventHandler(mainInputHandler);

   // adds all tasks
   gROOT->LoadMacro("AddAnalysisTaskAll.C");
   AddAnalysisTaskAll(format, useMC, opts);
}
开发者ID:sanyaade-speechtools,项目名称:alimv,代码行数:68,代码来源:AddAnalysisManagerTestTask.C

示例14: Info

void WebServer::onServerStopped () {
	Info(_log, "Stopped %s", _server->getServerName().toStdString().c_str());
	emit stateChange(false);
}
开发者ID:b1rdhous3,项目名称:hyperion.ng,代码行数:4,代码来源:WebServer.cpp

示例15: ModeHandler

int ModeHandler(int mode, char *textIn, int argc, char **argv)
{
	LcdSpi *lcd;
	Spi *spiBus0;
	ScreenData *screenBg;
	int result = 0;
	Fonts font;
	iconv_t ic;
	size_t res;
	char text[MAX_ISO8859_LEN] = "";
	
	memset(&font, 0, sizeof(Fonts));
	spiBus0 = SpiCreate(0);
	if (spiBus0 == NULL) {
		printf("SPI-Error\n");
		exit(EXITCODE_ERROR);
	}
	lcd = LcdOpen(spiBus0);
	if (!lcd) {
		printf("LCD-Error\n");
		exit(EXITCODE_ERROR);
	}
	if (gConfig.mIsInit == 1) {
		LcdInit(lcd);
	} else if (gConfig.mIsInit == 2) {
		LcdUninit(lcd);
		exit(EXITCODE_OK);
	}
	if (gConfig.mIsBgLight) {
		LcdSetBgLight(lcd, gConfig.mBgLight & 1, gConfig.mBgLight & 2, gConfig.mBgLight & 4);
	}
	screenBg = ScreenInit(LCD_X, LCD_Y);
	if (!screenBg) {
		printf("Screen-Error\n");
		exit(EXITCODE_ERROR);
	}
	ScreenClear(screenBg);
	if (gConfig.mBgFilename) {
		if (ScreenLoadImage(screenBg, gConfig.mBgFilename, gConfig.mBgOffX, gConfig.mBgOffY) != 0) {
			ScreenClear(screenBg);
		}
	}
	
	if (textIn) {
		int testInLen = strlen(textIn);
		char **inPtr = &textIn;
		char *outPtr = &text[0];
		
		ic = iconv_open("ISO-8859-1", "UTF-8");
		if (ic != (iconv_t)(-1)) {
			size_t inBytesLeft = testInLen;
			size_t outBytesLeft = sizeof(text) - 1;
		   
			res = iconv(ic, inPtr, &inBytesLeft, &outPtr, &outBytesLeft);
			if ((int)res != -1 && outBytesLeft) {
				outPtr[0] = 0;
			} else {
				strncpy(text, textIn, sizeof(text) - 1);
				text[sizeof(text) - 1] = 0;
			}
			iconv_close(ic);
		}
	}
	
	//printf("Mode: %i\n", mode);
	switch (mode) {
	case OPT_YESNO:
		LoadFonts(&font);
		result = YesNo(lcd, &font, text, screenBg);
		break;
	case OPT_OK:
		LoadFonts(&font);
		result = Ok(lcd, &font, text, screenBg);
		break;
	case OPT_MENU:
		LoadFonts(&font);
		result = Menu(lcd, &font, screenBg, optind, argc, argv);
		break;
	case OPT_IPV4:
		LoadFonts(&font);
		result = Ipv4(lcd, &font, text, screenBg, optind, argc, argv);
		break;
	case OPT_SUBNETMASK:
		LoadFonts(&font);
		result = Subnetmask(lcd, &font, text, screenBg, optind, argc, argv);
		break;
	case OPT_INFO:
		LoadFonts(&font);
		result = Info(lcd, &font, text, screenBg);
		break;
	case OPT_BUTTONWAIT:
		result = ButtonWait();
		break;
	case OPT_INTINPUT:
		LoadFonts(&font);
		result = IntInput(lcd, &font, text, screenBg, optind, argc, argv);
		break;
	case OPT_PROGRESS:
		LoadFonts(&font);
		result = Progress(lcd, &font, text, screenBg, optind, argc, argv);
//.........这里部分代码省略.........
开发者ID:rstephan,项目名称:lcdialog,代码行数:101,代码来源:lcdialog.c


注:本文中的Info函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。